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