from math import floor,ceil,sqrt
import fractions
import collections
import itertools
from collections import deque
X=int(input())
l=[]
for i in range(1,ceil(sqrt(X))+1):
    if X%i==0:
        l.append(i)
        l.append(X//i)
l=list(set(l))
l2=l
for i in range(len(l)):
    l2.append(-l[i])
#print(l2)
"""
for i in l:
    y=X//i
    print(i,y)
    if 60*y-35*pow(i,4)>=0:
        x=60*y-35*pow(i,4)
        print(sqrt(x))
        if sqrt(60*y-35*pow(i,4)).is_integer()==True:
            print(-10*pow(i,2)+sqrt(60*y-35*pow(i,4)))
            print(-10 * pow(i, 2) - sqrt(60 * y - 35 * pow(i, 4)))
            if (-10*pow(i,2)+sqrt(60*y-35*pow(i,4)))%15==0:
                ab=(-10*pow(i,2)+sqrt(60*y-35*pow(i,4)))//15
                if pow(i,2)-4*ab>=0:
                    if (-i+sqrt(pow(i,2)-4*ab)).is_integer()==True:
                        if (-i+sqrt(pow(i,2)-4*ab))%2==0:
                            b=(-i+sqrt(pow(i,2)-4*ab))//2
                            a=i-b
                            print(int(a),int(b))
                            break
                    elif (-i-sqrt(pow(i,2)-4*ab)).is_integer()==True:
                        if (-i-sqrt(pow(i,2)-4*ab))%2==0:
                            b=(-i-sqrt(pow(i,2)-4*ab))//2
                            a=i-b
                            print(int(a),int(b))
                            break
            elif (-10*pow(i,2)-sqrt(60*y-35*pow(i,4)))%15==0:
                ab=(-10*pow(i,2)-sqrt(60*y-35*pow(i,4)))//15
                if pow(i,2)-4*ab>=0:
                    if (-i+sqrt(pow(i,2)-4*ab)).is_integer()==True:
                        if (-i+sqrt(pow(i,2)-4*ab))%2==0:
                            b=(-i+sqrt(pow(i,2)-4*ab))//2
                            a=i-b
                            print(int(a),int(b))
                            break
                    elif (-i-sqrt(pow(i,2)-4*ab)).is_integer()==True:
                        if (-i-sqrt(pow(i,2)-4*ab))%2==0:
                            b=(-i-sqrt(pow(i,2)-4*ab))//2
                            a=i-b
                            print(int(a),int(b))
                            break
"""
l2.sort()
if len(l)!=0:
    for i in l2:
        x=X//i
        #print(i,x)
        n=(x-pow(i,4))/(pow(i,2)+1)
        #print(n)
        if (5*pow(i,4)+20*x)>=0:
            if sqrt((5*pow(i,4)+20*x)).is_integer()==True:
                #print(x,i)
                m=int(sqrt((5*pow(i,4)+20*x)))
                if (-5*i*i+m)%10==0:
                    y=(-5*i*i+m)//10
                    #print(i,y)
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
                elif (-5*i*i-m)%10==0:
                    y=(-5*i*i+m)//10
                    #print(i,y)
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break











Measured memory_bytes: 72728