#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int ans = 0;
  vector<int> v;
  int x = 1, y = 0;
  while (1) {
    if (x <= n && n - x - y > x) {
      ans++;
      v.push_back(x);
      y += x;
      x++;
      if (y == n) break;
    } else {
      v.push_back(n - y);
      ans++;
      break;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
