x = int(eval(input()))



i=1

cum=[0]

while cum[-1] < 10**9:

    cum+=[cum[-1]+i]

    i+=1



import bisect

index = bisect.bisect_left(cum, x)



print(index)
x = int(eval(input()))



i=1

while i*(i+1)//2 < x:

    i+=1



print(i)
x = int(eval(input()))
i = 1
cum = [0]
while cum[-1] < 10**9:
    cum += [cum[-1] + i]
    i += 1
import bisect

index = bisect.bisect_left(cum, x)
print(index)

x = int(eval(input()))
i = 1
while i * (i + 1) // 2 < x:
    i += 1
print(i)

-cum = [0] -while cum[-1] < 10**9: -    cum += [cum[-1] + i] +while i * (i + 1) // 2 < x: -import bisect - -index = bisect.bisect_left(cum, x) -print(index) +print(i)