#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count = 0;
  while ((count * (count + 1)) / 2 <= n) {
    ++count;
  }
  --count;
  int val = (count * (count + 1)) / 2;
  int diff = n - val;
  cout << count << "\n";
  for (int i = 1; i <= count; ++i) {
    if (i == count) {
      cout << count + diff << " ";
      break;
    }
    cout << i << " ";
  }
}
