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(){
    ulong x;
    scan(x);
    foreach(a;0..100){
        long b5=a^^5-x;
        foreach(b;iota(-100,100)){
            if(b^^5==b5){
                writefln("%s %s",a,b);
                return;
            }
        }
    }
}
