#include <bits/stdc++.h>
using namespace std;
void printarr(int arr[], int n) {
  for (int i = 0; i < n; i++) {
    cout << arr[i] << " ";
  }
  cout << endl;
}
int main() {
  int n;
  scanf("%d", &n);
  int c = 1, num = 1;
  while (c < n) {
    ++num;
    c += num;
  }
  if (c == n) {
    printf("%d", num);
    printf("\n");
    for (int i = 1; i <= num; i++) {
      printf("%d ", i);
    }
    printf("\n");
  } else {
    int diff = c - n;
    bool set[num + 1];
    memset(set, 1, num + 1);
    int c = num;
    int largest = num;
    while (diff != 0) {
      if (diff <= largest) {
        set[diff] = 0;
        diff = 0;
      } else {
        diff -= largest;
        set[largest--] = 0;
      }
      c--;
    }
    printf("%d", c);
    printf("\n");
    for (int i = 1; i <= num; i++) {
      if (set[i]) {
        printf("%d ", i);
      }
    }
    printf("\n");
  }
  return 0;
}
