#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i = 1;
  long long sum = i;
  vector<int> v;
  v.push_back(i);
  i++;
  sum += i;
  for (; sum <= n; i++, sum += i) v.push_back(i);
  if (sum > n) {
    int last = n - sum + i;
    if (i - 2 >= 0) v[i - 2] += last;
  }
  cout << v.size() << endl;
  for (auto x : v) cout << x << " ";
  return 0;
}
