Takahashi is participating in a contest with N problems, each worth i points. He aims to score exactly N points by choosing problems to solve. To minimize the highest score of a problem solved, he needs to determine the set of problems to solve. Constraints: 1 ≤ N ≤ 10^7. For a partial score, 200 points are awarded for N ≤ 1000, and an additional 100 points for passing without constraints. Given N, find a set of problems with a total score of N, where the highest score of a problem is minimum, and print the indices of the problems in the set. If multiple sets exist, any will be accepted.

# Buggy version:
n = int(input())
score = 0
i = 0
ans_list = []

while score < n:
    i += 1
    score += i
    ans_list.append(i)


ans_list.remove(score - n)
for k in range(len(ans_list)):
    print(ans_list[k])

# Fixed version:
n = int(input())
score = 0
i = 0
ans_list = []

while score < n:
    i += 1
    score += i
    ans_list.append(i)

if score == n:
    for k in range(len(ans_list)):
        print(ans_list[k])
else:
    ans_list.remove(score - n)
    for k in range(len(ans_list)):
        print(ans_list[k])

# Buggy version:
n = int(input())
now = 0
for i in range(1,n):
    now += i
    if now >= n:
        x = now-n
        for j in range(1,i+1):
            if j != x:
                print(j)
        exit()

# Fixed version:
n = int(input())
now = 0
for i in range(1,n+2):
    now += i
    if now >= n:
        x = now-n
        for j in range(1,i+1):
            if j != x:
                print(j)
        exit()

# Buggy version:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
cnt = 0
s = set()
for i in range(1, N):
    cnt += i
    s.add(i)
    if cnt>=N:
        break
if N!=cnt:
    s.remove(cnt-N)

for i in s:
    print(i)

# Fixed version:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
cnt = 0
s = set()
for i in range(1, N+1):
    cnt += i
    s.add(i)
    if cnt>=N:
        break
if N!=cnt:
    s.remove(cnt-N)

for i in s:
    print(i)

# Buggy version:
class BisectSearch:
    def __init__(self, f, l=0, r=10**9):
        self.f = f
        self.l = l
        self.r = r
    def __call__(self, dist):
        f = self.f
        l = self.l
        r = self.r
        if dist <= f(l):
            return l
        if f(r) <= dist:
            return r
        while r-l > 1:
            n = (r+l) // 2
            if f(n) <= dist:
                l = n
            else:
                r = n
        return l

n = int(input())
def f(n):
    return (n+1)*n // 2
m = BisectSearch(f, l=1, r=10**7)(n)
m += f(m) != n
A = set(range(1, m+1))
A.remove(f(m) - n)
print(*A, sep='\n')

# Fixed version:
class BisectSearch:
    def __init__(self, f, l=0, r=10**9):
        self.f = f
        self.l = l
        self.r = r
    def __call__(self, dist):
        f = self.f
        l = self.l
        r = self.r
        if dist <= f(l):
            return l
        if f(r) <= dist:
            return r
        while r-l > 1:
            n = (r+l) // 2
            if f(n) <= dist:
                l = n
            else:
                r = n
        return l

n = int(input())
def f(n):
    return (n+1)*n // 2
m = BisectSearch(f, l=1, r=10**7)(n)
m += f(m) != n
A = set(range(1, m+1))
A.discard(f(m) - n)
print(*A, sep='\n')

# Buggy version:
n = int(input())
now = 0
ans = []
for i in range(1, n):
    now += i
    ans.append(i)
    if now >= n:
        break

amari = now - n

for i in ans:
    if i == amari:
        continue
    else:
        print(i)


# Fixed version:
n = int(input())
if n == 1 or n == 2:
    print(n)
    exit()

now = 0
ans = []
for i in range(1, n):
    now += i
    ans.append(i)
    if now >= n:
        break

amari = now - n

for i in ans:
    if i == amari:
        continue
    else:
        print(i)

# Buggy version:
n = int(input())
ans = []
cnt = 0
for i in range(1, int(n**(2/3))):
    if n > cnt:
        ans.append(i)
        cnt += i
    else:
        if cnt - n in ans:
            ans.remove(cnt - n)
            break
for i in ans:
    print(i)

# Fixed version:
n = int(input())
ans = []
cnt = 0
for i in range(1, int(n**0.7)+3):
    if n > cnt:
        ans.append(i)
        cnt += i
    else:
        if cnt - n in ans:
            ans.remove(cnt - n)
        break
for i in ans:
    print(i)

# Buggy version:
N=int(input())
ans=0
reject=0
A=[]
for i in range(1,N+1):
    ans+=i
    if ans>N:
        reject=ans-N
        for j in range(1,i+1):
            if j!=reject:
                print(j)
        break

# Fixed version:
N=int(input())
ans=0
reject=0
A=[]
for i in range(1,N+1):
    ans+=i
    if ans>=N:
        reject=ans-N
        for j in range(1,i+1):
            if j!=reject:
                print(j)
        break

# Buggy version:
n=int(input())

ans=[1]
i=1
s=1
while True:
    if s>=n:
        break
    i+=1
    s+=i
    ans.append(i)

dif = s-n
if dif==0:
    for i in range(len(ans)):
        print(ans[i])
    exit(0)
    
for i in range(len(ans)):
    if a[i]==dif:
        continue
    print(ans[i])




# Fixed version:
n=int(input())

ans=[1]
i=1
s=1
while True:
    if s>=n:
        break
    i+=1
    s+=i
    ans.append(i)

dif = s-n
if dif==0:
    for i in range(len(ans)):
        print(ans[i])
    exit(0)

for i in range(len(ans)):
    if ans[i]==dif:
        continue
    print(ans[i])

# Buggy version:
N = int(input())

s = 0
l = []
for i in range(1, N):
    s += i
    l.append(i)
    if s > N:
        break
# print(l)

for i in range(len(l)):
    if s-l[i] == N:
        l.pop(i)
        break

for i in l:
    print(i)


# Fixed version:
N = int(input())

if N <= 2:
    print(N)
else:
    s = 0
    l = []
    for i in range(1, N):
        s += i
        l.append(i)
        if s > N:
            break
    # print(l)

    for i in range(len(l)):
        if s-l[i] == N:
            l.pop(i)
            break

    for i in l:
        print(i)

# Buggy version:
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 12 20:20:11 2020

@author: NEC-PCuser
"""


N = int(input())

i = 1
li = []
while (N >= (i * (i + 1)) // 2):
    li.append(i)
    i += 1
    

value = (i - 1) * i // 2
print(value)

index = len(li) - 1
for i in range(value, N):
    li[index] += 1
    index -= 1

for i in li:
    print(i)

# Fixed version:
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 12 20:20:11 2020

@author: NEC-PCuser
"""


N = int(input())

i = 1
li = []
while (N >= (i * (i + 1)) // 2):
    li.append(i)
    i += 1
    

value = (i - 1) * i // 2

index = len(li) - 1
for i in range(value, N):
    li[index] += 1
    index -= 1

for i in li:
    print(i)

# Buggy version:
n=int(input())
s=0
l=[]
for i in　range(1,n+1):
 s+=i
 l.append(i)
 if s>=n:
  for j in l:
   if j!=s-n:
    print(j)
  break

# Fixed version:
n=int(input())
s=0
l=[]
for i in range(1,n+1):
 s+=i
 l.append(i)
 if s>=n:
  for j in l:
   if j!=s-n:
    print(j)
  break

# Buggy version:
#import itertools
#import bisect
import math

N = int(input())
L = [i for i in range((N+1)//2+1)]
num = math.ceil(pow(2*(N-1),0.5))
    
for i in range(num,len(L)):
    if N == i*(i+1)//2:
        index = i
        Max = i*(i+1)//2
        break
    elif N < i*(i+1)//2:
        index = i
        Max = i*(i+1)//2
        break
Left = Max - N 
    
#acu = list(itertools.accumulate([i for i in range((N+1)//2+2)]))
#print(acu) 
#index = bisect.bisect_left(acu,N)
#print(index)

Left = Max - N    
#if acu[index] == N:
#    Max = acu[index-1]
#else:
#    Max = acu[index]
#Left = Max - N

for i in range(1,index+1):
    if i == Left:
        continue
    print(i)

# Fixed version:
#import itertools
#import bisect
import math

N = int(input())
L = [i for i in range((N+2)//2+2)]
num = math.floor(pow(2*(N-1),0.5))
    
for i in range(num,len(L)):
    if N == i*(i+1)//2:
        index = i
        Max = i*(i+1)//2
        break
    elif N < i*(i+1)//2:
        index = i
        Max = i*(i+1)//2
        break
Left = Max - N 
#print(num,Left,Max,index,L)
#acu = list(itertools.accumulate([i for i in range((N+1)//2+2)]))
#print(acu) 
#index = bisect.bisect_left(acu,N)
#print(index)
 
#if acu[index] == N:
#    Max = acu[index-1]
#else:
#    Max = acu[index]
#Left = Max - N

for i in range(1,index+1):
    if i == Left:
        continue
    print(i)

# Buggy version:
n = int(input())

s = 0
i = 0
while s < n:
    s += i
    i += 1

if i == 1:
    print(1)
    exit()
ans = list(range(1,i))
ans.remove(s-n)
print('\n'.join(map(str,ans)))


# Fixed version:
n = int(input())

s = 0
i = 0
while s < n:
    s += i
    i += 1

if i == 1:
    print(1)
else:
    ans = list(range(1,i))
    if s - n != 0: ans.remove(s-n)
    print('\n'.join(map(str,ans)))

# Buggy version:
n = int(input())
def main(n):
    if n == 1:
        return 1,0
    m = n //2 
    for i in range(1,m+1):
        if i * (i + 1) <= 2*n <= (i+1)*(i+2):
           right  = i + 1
           break
       
    diff = right * (right+1) //2 - n
       
    return right+1,diff


right,diff = main(n)

for i in range(1,right):
    if i != diff:
        print(i)


# Fixed version:
n = int(input())
def main(n):
    if n == 1:
        return 2,0
    
    if n == 3:
        return 3,0
    m = n //2 
    for i in range(1,m+1):
        if i * (i + 1) <= 2*n < (i+1)*(i+2):
           right  = i + 1
           break
       
    diff = right * (right+1) //2 - n
       
    return right+1,diff


right,diff = main(n)

for i in range(1,right):
    if i != diff:
        print(i)

# Buggy version:
n = int(input())
k = 1
while True:
  if k*(k+1)//2 >= n:
    ans = k
    break
  k += 1
if n == k*(k+1)//2:
  i = 1
  while i <= ans:
    print(i)
    i += 1
else:
  i = 1
  l = []
  cnt = 0
  while i < ans:
    if cnt <= (ans-1)*(ans+2)//2 - n:
      print(i)
      cnt += 1
    else:
      print(i+1)
    i += 1
    



# Fixed version:
n = int(input())
k = 1
while True:
  if k*(k+1)//2 >= n:
    ans = k
    break
  k += 1
if n == ans*(ans+1)//2:
  i = 1
  while i <= ans:
    print(i)
    i += 1
else:
  i = 1
  l = []
  cnt = 1
  while i < ans:
    if cnt <= (ans-1)*(ans+2)//2 - n:
      print(i)
      cnt += 1
    else:
      print(i+1)
    i += 1

# Buggy version:
n = int(input())
r = 10**7+1
l = 1

def f(n):
  return n**2+n

while r-l>1:
  if f((l+r)//2)>n:
    r = (l+r)//2
  else:
    l = (l+r)//2
l = l+1
rm = (l+1)*l//2-n
ans = list(range(1, l+1))
ans.remove(rm)
for a in ans:
  print(a)

# Fixed version:
n = int(input())
r = 10**7+1
l = 1

def f(n):
  return (n**2+n)//2

while r-l> 1:
  if f((l+r)//2)>n:
    r = (l+r)//2
  else:
    l = (l+r)//2

l = l+1
rm = (l+1)*l//2-n
ans = list(range(1, l+1))
ans.remove(rm)
for a in ans:
  print(a)

# Buggy version:
# CODE FESTIVAL 2016 Final
# B - Exactly N points
# https://atcoder.jp/contests/cf16-final/tasks/codefestival_2016_final_b
N = int(input())
for i in range(1, N):
    if i*(i+1)//2 >= N:
        k = i
        break

S = k*(k+1)//2
sub = S-N
for i in range(1, k+1):
    if i == sub:
        continue
    print(i)


# Fixed version:
# CODE FESTIVAL 2016 Final
# B - Exactly N points
# https://atcoder.jp/contests/cf16-final/tasks/codefestival_2016_final_b
N = int(input())
for i in range(1, N+1):
    if i*(i+1)//2 >= N:
        k = i
        break


S = k*(k+1)//2
sub = S-N
for i in range(1, k+1):
    if i == sub:
        continue
    print(i)
1

# Buggy version:
n=int(input())
i=0
while i*(i+1)//2<n:
  i+=1
no=n-i*(i+1)//2
for j in range(1,i+1):
  if j!=no:
    print(j)

# Fixed version:
n=int(input())
i=0
while i*(i+1)//2<n:
  i+=1
no=i*(i+1)//2-n
for j in range(1,i+1):
  if j!=no:
    print(j)

# Buggy version:
# coding: utf-8
N = int(input())
if N == 1:
    print(1)
    exit()
ans = 0
for i in range(1, N+1):
    ans += i
    if ans >= N:
        end = i
        break
res = ans - N
for i in range(1, end):
    if i != res:
        print(i)

# Fixed version:
# coding: utf-8
N = int(input())
if N == 1:
    print(1)
    exit()
ans = 0
for i in range(1, N+1):
    ans += i
    if ans >= N:
        end = i
        break
res = ans - N
for i in range(1, end+1):
    if i != res:
        print(i)

# Buggy version:
import math
N=int(input())
p=math.sqrt(N*2-0.25)-0.5
q=int(p)+1
M=q*(q+1)//2
L=M-N#must0or+
for i in range(q+1):
    if i != L:
        print(i)

# Fixed version:
import math
N=int(input())
p=math.sqrt(N*2-0.25)-0.5
q=int(p)+1
M=q*(q+1)//2
L=M-N#must0or+
for i in range(1,q+1):
    if i != L:
        print(i)

# Buggy version:
N=int(input())

for i in range(1,N):
  if i*(i+1)//2 >= N:
    break
    
c = i*(i+1)//2 - N

for j in range(1,i+1):
  if j!=c:
    print(j)

# Fixed version:
N=int(input())
k=1

for i in range(1,N+1):
  if i*(i+1)//2 >= N:
    k=i
    break
    
c = int(k*(k+1)//2 - N)

for j in range(1,k+1):
  if j!=c:
    print(j)

# Buggy version:
n = int(input())
for i in range(1,n):
  if i*(i+1)//2 > n:
    x = i
    y = i*(i+1)//2 - n
    break
for i in range(1,x+1):
  if i != y:
    print(i)

# Fixed version:
n = int(input())
for i in range(1,n+2):
  if i*(i+1)//2 > n:
    x = i
    y = i*(i+1)//2 - n
    break
for i in range(1,x+1):
  if i != y:
    print(i)

# Buggy version:
def solve():
    N = int(input())
    score = 0
    for i in range(1, n+1):
        score += i
        if score >= n:
            break
    x = score - n
    res = list(range(1, x)) + list(range(x+1, i+1))
    return '\n'.join(map(str, res))
    
print(solve())

# Fixed version:
def solve(n):
    score = 0
    for p in range(1, n+1):
        score += p
        if score >= n:
            break
    x = score - n
    res = list(range(1,x)) + list(range(x+1,p+1))
    return "\n".join(map(str, res))

n = int(input())
print(solve(n))

# Buggy version:
from itertools import accumulate
from math import sqrt, floor
from bisect import bisect_left

N = int(input())
n = list(accumulate(range(floor(sqrt(2 * N)) + 1)))

r = bisect_left(n, N)

if n[r] == N:
    print('\n'.join(map(str, range(1, r + 1))))
    exit()

d = n[r] - N
for i in range(1, r + 1):
    if i != d:
        print(i)

# Fixed version:
from itertools import accumulate
from math import sqrt
from bisect import bisect_left

N = int(input())
n = list(accumulate(range(int(sqrt(2 * N)) + 2)))

r = bisect_left(n, N)

if n[r] == N:
    print('\n'.join(map(str, range(1, r + 1))))
    exit()

d = n[r] - N
for i in range(1, r + 1):
    if i != d:
        print(i)

# Buggy version:
N=int(input())
S=[1]
for i in range(1,N):
  S.append(S[i-1]+i+1)
p=0
j=0
while N>=S[j]:
  j += 1
p=S[j]-N
for i in range(1,j+2):
  if i!=p:
    print(i)

# Fixed version:
N=int(input())
S=[1]
for i in range(1,N):
  S.append(S[i-1]+i+1)
p=0
j=0
if N==1:
  print(1)
else:
  while N>=S[j]:
    j += 1
  p=S[j]-N
  for i in range(1,j+2):
    if i!=p:
      print(i)

# Buggy version:
N=int(input())
N=10**7
lst=set()
num=0
for i in range(1,N+1):
    lst.add(i)
    num+=i
    if num>=N:
        if num==N:
            break
        else:
            lst.remove(num-N)
            break
for s in lst:
    print(s)


# Fixed version:
N=int(input())
lst=set()
num=0
for i in range(1,N+1):
    lst.add(i)
    num+=i
    if num>=N:
        if num==N:
            break
        else:
            lst.remove(num-N)
            break
for s in lst:
    print(s)

# Buggy version:
n=int(input())
for i in range(n):
	if i**2+i>=2*n:
		p=i
		break
total=(p*(p+1))//2
for i in range(1,p+1):
	if total-n!=i:
		print(i)

# Fixed version:
n=int(input())
for i in range(n+1):
	if i**2+i>=2*n:
		p=i
		break
total=(p*(p+1))//2
for i in range(1,p+1):
	if total-n!=i:
		print(i)

# Buggy version:
n=int(input())

for i in range(n):
    if i+i**2>=2*n:
        check=i
        break

total=(1+check)*check//2
out=total-n

for i in range(1,check+1):
    if i!=out:
        print(i)


# Fixed version:
n=int(input())


if n==1:
    print(1)
    exit()
    
if n==2:
    print(2)
    exit()
    
for i in range(n):
    if i+i**2>=2*n:
        check=i

        break

total=(1+check)*check//2
out=total-n

for i in range(1,check+1):
    if i!=out:
        print(i)

# Buggy version:
import math
N=int(input())
M=int(math.sqrt(N*2-0.25)+0.5)
left = M*(M-1) // 2
sum_=0
for i in range(1,M-(N-left)):
    print(i)
    sum_ += i
for i in range(M-(N-left),M):
    print(i+1)
    sum_ += i+1
print(sum_)

# Fixed version:
import math
N=int(input())
M=int(math.sqrt(N*2-0.25)+0.5)
left = M*(M-1) // 2
sum_=0
for i in range(1,M-(N-left)):
    print(i)
    sum_ += i
for i in range(M-(N-left),M):
    print(i+1)
    sum_ += i+1

# Buggy version:
N = int(input())

ans_max = 0
while ans_max * (ans_max + 1) / 2 < N:
    ans_max += 1

num_remove = ans_max - N
for i in range(1, ans_max + 1):
    if i != num_remove:
        print(i)


# Fixed version:
N = int(input())

ans_max = 0
while ans_max * (ans_max + 1) / 2 < N:
    ans_max += 1

num_remove = ans_max * (ans_max + 1) // 2 - N
for i in range(1, ans_max + 1):
    if i != num_remove:
        print(i)

# Buggy version:
# cf16-finalB - Exactly N points
def main():
    # N <= cnt (1 + 2 + ... + ma) -> 1 ~ ma except ex
    N = int(input())
    cnt, ma = 0, 0
    for i in range(1, N):
        cnt += i
        if cnt >= N:
            ma = i
            break
    ex = cnt - N  # exclusion
    ans = [i for i in range(1, ma + 1) if i != ex]
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()

# Fixed version:
# cf16-finalB - Exactly N points
def main():
    # N <= cnt (1 + 2 + ... + ma) -> 1 ~ ma except ex
    N = int(input())
    cnt, ma = 0, 0
    for i in range(1, N + 1):
        cnt += i
        if cnt >= N:
            ma = i
            break
    ex = cnt - N  # exclusion
    ans = [i for i in range(1, ma + 1) if i != ex]
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()

# Buggy version:
import math
N=int(input())
for i in range(int(math.sqrt(N)) , int(math.sqrt(2*N))+1):
    if (i*(i+1))//2 >= N:
        ansmax=i
        dif=(i*(i+1))//2 - N

for j in range(1,ansmax+1):
    if j!=dif:
        print(j)

# Fixed version:
import math
N=int(input())
for i in range(int(math.sqrt(N)) , int(math.sqrt(2*N+1))+100):
    if (i*(i+1))//2 >= N:
        ansmax=i
        dif=(i*(i+1))//2 - N
        break

for j in range(1,ansmax+1):
    if j!=dif:
        print(j)

# Buggy version:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  N=II()
  if N==1:
    exit()

  i=1
  l=[i]
  sm=i
  while True:
    if sm==N:
      break
    elif sm>N:
      l.remove(sm-N)
      break
    else:
      i+=1
      l.append(i)
      sm+=i

  for x in l:
    print(x)

main()
# print(main())


# Fixed version:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  N=II()

  i=1
  l=[i]
  sm=i
  while True:
    if sm==N:
      break
    elif sm>N:
      l.remove(sm-N)
      break
    else:
      i+=1
      l.append(i)
      sm+=i

  for x in l:
    print(x)

main()
# print(main())

# Buggy version:
n=int(input())
for i in range((2*n)**0.5-3,n**0.5+2):
  if i*(i+1)//2=n:
    for j in range(1,i+1):
      print(j)
    break
  elif i*(i+1)//2>n:
    k=i*(i+1)//2-n
    for j in range(1,i+1):
      ifr j!=k:
        print(j)
    break

# Fixed version:
n=int(input())
for i in range(int((2*n)**0.5-3),n+2):
  if i*(i+1)//2==n:
    for j in range(1,i+1):
      print(j)
    break
  elif i*(i+1)//2>n:
    k=i*(i+1)//2-n
    for j in range(1,i+1):
      if j!=k:
        print(j)
    break