def create_koho(X):

    koho = [1]

    koho_sum = 1

    i = 1

    while koho_sum < X:

        i += 1

        koho.append(i)

        koho_sum += i



    return koho





X = int(eval(input()))

koho = create_koho(X)

nokori = X

ans = 0

for i in reversed(koho):

    if nokori >= i:

        nokori -= i

        ans += 1



print((len(koho)))

X = int(eval(input()))



i = 1

koho_sum = i

while koho_sum < X:

    i += 1

    koho_sum += i

print(i)

def create_koho(X):
    koho = [1]
    koho_sum = 1
    i = 1
    while koho_sum < X:
        i += 1
        koho.append(i)
        koho_sum += i
    return koho


X = int(eval(input()))
koho = create_koho(X)
nokori = X
ans = 0
for i in reversed(koho):
    if nokori >= i:
        nokori -= i
        ans += 1
print((len(koho)))

X = int(eval(input()))
i = 1
koho_sum = i
while koho_sum < X:
    i += 1
    koho_sum += i
print(i)

-def create_koho(X): -    koho = [1] -    koho_sum = 1 -    i = 1 -    while koho_sum < X: -        i += 1 -        koho.append(i) -        koho_sum += i -    return koho - - -koho = create_koho(X) -nokori = X -ans = 0 -for i in reversed(koho): -    if nokori >= i: -        nokori -= i -        ans += 1 -print((len(koho))) +i = 1 +koho_sum = i +while koho_sum < X: +    i += 1 +    koho_sum += i +print(i)