#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int> > matrix(n + 1, vector<int>(n + 1, 0));
  int max_i = n, max_j = 0;
  for (int i = 1; i <= max_i; ++i) {
    max_j += i;
    for (int j = 1; j <= max_j && j <= n; ++j) {
      if (j - i >= 0) matrix[i][j] = matrix[i - 1][j - i] + 1;
      matrix[i][j] = max(matrix[i][j], matrix[i - 1][j]);
    }
    if (max_i <= max_j) max_i = i;
  }
  cout << matrix[max_i][n] << '\n';
  vector<int> answer;
  while (n != 0) {
    if (matrix[max_i][n] != matrix[max_i - 1][n]) {
      answer.push_back(max_i);
      n -= max_i;
      max_i -= 1;
    } else
      max_i -= 1;
  }
  for (int k : answer) cout << k << ' ';
}
