The problem set at _CODE FESTIVAL 20XX Finals_ consists of N problems.  The score allocated to the i-th (1≦i≦N) problem is i points.  Takahashi, a contestant, is trying to score exactly N points. For that, he is deciding which problems to solve.  As problems with higher scores are harder, he wants to minimize the highest score of a problem among the ones solved by him.  Determine the set of problems that should be solved.
n = int(input())
ans = []
tmp = 0
i = 1
while tmp < n:
    ans.append(i)
    tmp += i
    i += 1
print('\n'.join(map(str, ans)))

n = int(input())
ans = []
tmp = n
for i in range(min(n, 5000), 0, -1):
    if tmp > i * (i - 1) // 2:
        ans.append(i)
        tmp -= i
ans.sort()
print('\n'.join(map(str, ans)))
