#include <bits/stdc++.h>
bool isprime[100000];
using namespace std;
void setprime() {
  for (int i = 1; i < 100005; i++) isprime[i] = true;
  isprime[0] = false;
  isprime[1] = false;
  for (int i = 2; i * i < 100005; i++) {
    if (isprime[i] == true) {
      for (int j = (2 * i); j < 100005; j += i) isprime[j] = false;
    }
  }
}
long long mod = 1000000007;
long long N = 1000005;
long long abSolute(long long a) {
  if (a >= 0)
    return a;
  else
    return (-1) * a;
}
bool otherO(string t) {
  long long cl = 0, count = 0, l = t.length();
  for (long long i = 0; i < l; i++) {
    if (t[i] != '0' || t[i] != '1') {
      return false;
    } else if (t[i] == '1')
      cl++;
    std::cout << cl << " ";
  }
  if (cl == 1)
    return true;
  else
    return false;
}
long long countZero(string t) {
  long long count = 0, l = t.length();
  for (long long i = 0; i < l; i++) {
    if (t[i] == '0') count++;
  }
  return count;
}
vector<long long> dp(1000005);
void createDP() {
  for (long long i = 0; i < 1000005; i++) {
    if (i == 0)
      dp[i] = 0;
    else
      dp[i] = dp[i - 1] + i;
  }
}
long long BinarySearch(long long arr[], long long first, long long last,
                       long long search) {
  long long middle = (first + last) / 2;
  while (first <= last) {
    if (arr[middle] < search) {
      first = middle + 1;
    } else if (arr[middle] == search) {
      return middle;
    } else {
      last = middle - 1;
    }
    middle = (first + last) / 2;
  }
  if (first > last) {
    return -1;
  }
}
bool isUp(string s, long long i, long long j) {
  for (long long z = i; z <= j; z++) {
    if (s[z] >= 'A' && s[z] <= 'Z') return false;
  }
  return true;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed;
  cout << setprecision(12);
  long long n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl << 1;
    return 0;
  }
  long long i, j, tmp;
  for (i = 1; i <= n; i++) {
    tmp = i * (i + 1) / 2;
    if (tmp > n) break;
  }
  cout << --i << endl;
  for (j = 1; j <= i + 1; j++)
    if ((tmp - n) != j) cout << j << " ";
  return 0;
}
