#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=2e5+9;
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
ios_base::sync_with_stdio(0);
cin.tie(0);
ll n;
cin>>n;
map<ll,int>vis;
vector<ll> v;
for(ll i=1;i<=n;i++){
if(n-i>=0 && vis[n-i]==0){
vis[i]=1;
v.push_back(i);
n-=i;
}
else {
if(n>0)v.push_back(n);
break;
}
}
cout<<v.size()<<'\n';
for(auto x:v){
cout<<x<<" ";
}
}