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