#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
long long MOD = 100000000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, x;
  cin >> n;
  vector<int> a;
  x = n;
  for (int i = 1; n >= i; n -= i, i++) {
    a.push_back(i);
  }
  int nn = a.size();
  cout << nn << endl;
  for (int i = 0; i < nn; ++i) {
    if (a[i] + n > nn) {
      cout << a[i] + n << ' ';
      n = 0;
      continue;
    }
    cout << a[i] << ' ';
  }
  cout << endl;
  return 0;
}
