import sys

sys.setrecursionlimit(10**7)

def is_ok(m, n):

    return m*(m+1)//2>=n

def meguru_bisect(ng, ok, n):

    while (abs(ok - ng) > 1):

        mid = (ok + ng) // 2

        if is_ok(mid, n):

            ok = mid

        else:

            ng = mid

    return ok

def f(n):

    if n>0:

        m = meguru_bisect(0,10**7, n)

        print(m)

        f(n-m)

N = int(eval(input()))

f(N)

N=int(eval(input()))

m=1

while m*(m+1)<2*N:m+=1

for i in range(1,m+1):

    if m*(m+1)//2-i!=N:print(i)



import sys

sys.setrecursionlimit(10**7)


def is_ok(m, n):
    return m * (m + 1) // 2 >= n


def meguru_bisect(ng, ok, n):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if is_ok(mid, n):
            ok = mid
        else:
            ng = mid
    return ok


def f(n):
    if n > 0:
        m = meguru_bisect(0, 10**7, n)
        print(m)
        f(n - m)


N = int(eval(input()))
f(N)

N = int(eval(input()))
m = 1
while m * (m + 1) < 2 * N:
    m += 1
for i in range(1, m + 1):
    if m * (m + 1) // 2 - i != N:
        print(i)

-import sys - -sys.setrecursionlimit(10**7) - - -def is_ok(m, n): -    return m * (m + 1) // 2 >= n - - -def meguru_bisect(ng, ok, n): -    while abs(ok - ng) > 1: -        mid = (ok + ng) // 2 -        if is_ok(mid, n): -            ok = mid -        else: -            ng = mid -    return ok - - -def f(n): -    if n > 0: -        m = meguru_bisect(0, 10**7, n) -        print(m) -        f(n - m) - - -f(N) +m = 1 +while m * (m + 1) < 2 * N: +    m += 1 +for i in range(1, m + 1): +    if m * (m + 1) // 2 - i != N: +        print(i)