#include <bits/stdc++.h>
using namespace std;
int a, f[1001], n, s;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    s = s + i;
    if (s <= n) {
      a++;
      f[a] = i;
    } else {
      f[i - 1] = n - s + i + i - 1;
      break;
    }
  }
  cout << a << endl;
  for (int i = 1; i <= a; i++) {
    cout << f[i] << " ";
  }
}
