#include <bits/stdc++.h>
using namespace std;
using namespace std;
int a[10000];
int main() {
  int t;
  t = 1;
  while (t--) {
    int n, i, x, y;
    vector<int> v;
    cin >> n;
    for (i = 1; i <= n; i++) {
      if (a[n - i] == 0 && (n - i) != i) {
        a[i] = 1;
        v.push_back(i);
        n = n - i;
      } else {
        a[n] = 1;
        v.push_back(n);
        break;
      }
    }
    cout << v.size() << endl;
    for (i = 0; i < v.size(); i++) cout << v[i] << " ";
    cout << endl;
  }
}
