#include <bits/stdc++.h>
using namespace std;
long long int n;
int main() {
  cin >> n;
  long long int s(0);
  long long int i = 1;
  while (true) {
    s += i;
    if (s >= n) {
      break;
    }
    i++;
  }
  long long int sk = s - n;
  if (sk != 0) {
    cout << i - 1 << "\n";
  } else {
    cout << i << "\n";
  }
  for (long long int I = 1; I <= i; I++) {
    if (I == sk) {
      continue;
    }
    cout << I << " ";
  }
  cout << "\n";
  return 0;
}
