#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, n = 0, t = -1;
  cin >> a;
  if (a == 1)
    cout << 1 << endl << 1;
  else {
    for (int i = 1; i < a; i++) {
      if (i + 1 > a - (i * (i + 1) / 2) && t == -1)
        t = 0;
      else if (i + 1 == a - (i * (i + 1) / 2) && t == -1)
        n++;
      else if (t == -1)
        n++;
    }
    cout << n + 1 << endl;
    t = -1;
    for (int i = 1; i < a; i++) {
      if (i + 1 > a - (i * (i + 1) / 2) && t == -1) {
        cout << a - i * (i - 1) / 2;
        t = 0;
      } else if (i + 1 == a - (i * (i + 1) / 2) && t == -1) {
        cout << i << " " << i + 1;
        t = 0;
      } else if (t == -1) {
        cout << i << " ";
      }
    }
  }
  return 0;
}
