#include <bits/stdc++.h>
using namespace std;
int ara[30010];
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl << 1 << endl;
    return 0;
  } else if (n == 2) {
    cout << 1 << endl << 2 << endl;
    return 0;
  }
  int currentSum = 1;
  vector<int> numbers;
  numbers.push_back(1);
  for (int i = 2; i <= n; i++) {
    if (currentSum == n) {
      cout << numbers.size() << endl;
      for (auto it = numbers.begin(); it != numbers.end(); it++) {
        cout << *it << " ";
      }
      cout << endl;
      return 0;
    }
    if (n - (currentSum + i) > i || n - (currentSum + i) == 0) {
      currentSum += i;
      numbers.push_back(i);
    }
  }
}
