#include <cstdio>
int n;
int Count()
{
int i = 1, x = n;
while (i <= x)
x -= i++;
return i - 1;
}
int main()
{
freopen("sumdiff.in", "r", stdin);
freopen("sumdiff.out", "w", stdout);
scanf("%d", &n);
printf("%d\n", Count());
int i = 1, x = n;
while (2 * i + 1 <= x)
printf("%d ", i), x -= i++;
printf("%d\n", x);
return 0;
}