x = int(eval(input()))

ans = 0

i = 1

while ans<x:

    ans+=i

    i+=1

print((i-1))
x = int(eval(input()))

i,cnt = 0,0

while cnt < x:

    i = i + 1

    cnt += i

print(i)
x = int(eval(input()))
ans = 0
i = 1
while ans < x:
    ans += i
    i += 1
print((i - 1))

x = int(eval(input()))
i, cnt = 0, 0
while cnt < x:
    i = i + 1
    cnt += i
print(i)

-ans = 0 -i = 1 -while ans < x: -    ans += i -    i += 1 -print((i - 1)) +i, cnt = 0, 0 +while cnt < x: +    i = i + 1 +    cnt += i +print(i)