x=int(eval(input()))

n=1

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

  n+=1

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

#n=1

#while 1/2*(n**2+n)<x:

#  n+=1

#print(n)



left=0

right=x

while right-left>1:

  mid=(left+right)//2

  if (mid**2+mid)/2==x:

    right=mid

    break

  if (mid**2+mid)/2<x:

    left=mid

  else:

    right=mid

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

x = int(eval(input()))
# n=1
# while 1/2*(n**2+n)<x:
#  n+=1
# print(n)
left = 0
right = x
while right - left > 1:
    mid = (left + right) // 2
    if (mid**2 + mid) / 2 == x:
        right = mid
        break
    if (mid**2 + mid) / 2 < x:
        left = mid
    else:
        right = mid
print(right)

-n = 1 -while 1 / 2 * (n**2 + n) < x: -    n += 1 -print(n) +# n=1 +# while 1/2*(n**2+n)<x: +#  n+=1 +# print(n) +left = 0 +right = x +while right - left > 1: +    mid = (left + right) // 2 +    if (mid**2 + mid) / 2 == x: +        right = mid +        break +    if (mid**2 + mid) / 2 < x: +        left = mid +    else: +        right = mid +print(right)