import std;
enum inf(T)()if(__traits(isArithmetic,T)){return T.max/4;}
T scan(T=long)(){return readln.chomp.to!T;}
void scan(T...)(ref T args){auto input=readln.chomp.split;foreach(i,t;T)args[i]=input[i].to!t;}T[] scanarr(T=long)(){return readln.chomp.split.to!(T[]);}
//END OF TEMPLATE

void main(){
    long x;
    scan(x); 
    ulong n=100;
    foreach(_a;0..n){
        long a=_a;
        foreach(_b;0..n){
            long b=_b;
            if(a^^5<x){
                if(a^^5+b^^5==x){
                    writefln("%s %s",a,-b);
                    return;
                }
            }else{
                if(a^^5-b^^5==x)
                    writefln("%s %s",a,b);
                    return;
            }
        }
    }
}
