Problem:
Score : 400 points

Problem Statement

Give a pair of integers (A, B) such that A^5-B^5 = X.
It is guaranteed that there exists such a pair for the given integer X.

Constraints

1 \leq X \leq 10^9

X is an integer.

There exists a pair of integers (A, B) satisfying the condition in Problem Statement.

Input

Input is given from Standard Input in the following format:

X

Output

Print A and B, with space in between.
If there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.

A B

Sample Input 1

33

Sample Output 1

2 -1

For A=2 and B=-1, A^5-B^5 = 33.

Sample Input 2

1

Sample Output 2

0 -1

Solution in Python (3.8.2) (judge verdict: Time Limit Exceeded)

X = int(input())

root = int(X**(1/5))

A_cands = [root-1, root, root+1]
B_cands = []
for c in A_cands:
    if c**5 < X:
        rest = X - c**5
        another = -int(rest**(1/5))
        B_cands.append(another)
    else:
        rest = c**5 - X
        another = int(rest**(1/5))
        B_cands.append(another)

tmp = 1

for i in range(3):
    if A_cands[i]**5 - B_cands[i]**5 == X:
        print(A_cands[i], B_cands[i])
        import sys
        sys.exit()


while (A_cands[0]**5 - B_cands[0]**5 != X) and (A_cands[1]**5 - B_cands[1]**5 != X) and (A_cands[2]**5 - B_cands[2]**5 != X):
    for i,b_cand in enumerate(B_cands):
        another_plus = b_cand + 1
        another_minus = b_cand - 1
        if A_cands[i]**5 - another_plus**5 == X:
            B_cands[i] = another_plus
            ans_idx = i
            break
        if A_cands[i]**5 - another_minus**5 == X:
            B_cands[i] = another_minus
            ans_idx = i
            break
    tmp += 1

print(A_cands[ans_idx], B_cands[ans_idx])