#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, t, sum = 0, tt;
  cin >> n >> t;
  sum = n;
  for (i = 1; i <= n; i++) {
    tt = i;
    sum = sum - i;
    if (sum <= i) {
      t = sum + i;
      i--;
      break;
    }
  }
  cout << tt << '\n';
  for (int j = 1; j <= i; j++) cout << j << ' ';
  cout << t;
  return 0;
}
