#include <bits/stdc++.h>
using namespace std;
int n, maxx = -1;
vector<int> kq, x;
bool ok = false;
void BT(int u, int val, int s) {
  if (ok) return;
  if (s == n) {
    ok = true;
    maxx = u;
    kq = x;
    return;
  } else
    for (int i = val + 1; i <= n - s; i++) {
      if (s + i <= n) {
        x.push_back(i);
        BT(u + 1, i, s + i);
        x.pop_back();
      }
    }
}
int main() {
  cin >> n;
  BT(1, 0, 0);
  cout << kq.size() << endl;
  for (int i = 0; i < kq.size(); i++) cout << kq[i] << " ";
  return 0;
}
