x = int(input())
best = 1
for i in range(2, x):
if i*(i+1)/2 <= x:
best = i
else:
break
x -= best*(best-1)/2
l = list(range(1, best))
if x != 0:
l.append(int(x))
print(len(l))
print(" ".join(map(str, l)))