#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<utility>
#include<numeric>
#include<cmath>

using namespace std;

bool check(long long a, long long b, long long X){
    return ( a*a*a*a*a - b*b*b*b*b == X);
}

int main()
{
    long long X, t, k, a, b, u, v, s, D, U;
    cin >> X;

    for(int p=1;p*p<=X;++p){
        if(X%p != 0) continue;

        k = p;
        
        U = X/p;
        D = 5*(k*k*k*k + 4*U);
        if( D < 0) continue;
        u = static_cast<long long>(sqrt(D));
        if( u*u != D ) continue;

        if( (-5*k*k + u  )%10 == 0 ){
            t = (u-5*k*k) / 10;
            v = k*k + 4*t;
            if(v>=0){
                s = static_cast<long long>(sqrt(v));
                if(s*s == v){
                    if((s+k)%2 == 0){
                        a = (s+k) / 2;
                        b = (s-k) / 2;
                        if( check(a,b,X) ) break;
                        a = (-s+k) /2;
                        b = (-s-k) /2;
                        if( check(a,b,X) ) break;
                    }
                }
            }
        }

        if( (-5*k*k - u  )%10 == 0 ){
            t = (-u-5*k*k) / 10;
            v = k*k + 4*t;
            if(v>=0){
                s = static_cast<long long>(sqrt(v));
                if(s*s == v){
                    if((s+k)%2 == 0){
                        a = (s+k) / 2;
                        b = (s-k) / 2;
                        if( check(a,b,X) ) break;
                        a = (-s+k) /2;
                        b = (-s-k) /2;
                        if( check(a,b,X) ) break;
                    }
                }
            }
        }
        
        k = -p;
        U = -X/p;
        D = 5*(k*k*k*k + 4*U);
        if( D < 0) continue;
        u = static_cast<long long>(sqrt(D));
        if( u*u != D ) continue;

        if( (-5*k*k + u  )%10 == 0 ){
            t = (u-5*k*k) / 10;
            v = k*k + 4*t;
            if(v>=0){
                s = static_cast<long long>(sqrt(v));
                if(s*s == v){
                    if((s+k)%2 == 0){
                        a = (s+k) / 2;
                        b = (s-k) / 2;
                        if( check(a,b,X) ) break;
                        a = (-s+k) /2;
                        b = (-s-k) /2;
                        if( check(a,b,X) ) break;
                    }
                }
            }
        }
        if( (-5*k*k - u  )%10 == 0 ){
            t = (-u-5*k*k) / 10;
            v = k*k + 4*t;
            if(v>=0){
                s = static_cast<long long>(sqrt(v));
                if(s*s == v){
                    if((s+k)%2 == 0){
                        a = (s+k) / 2;
                        b = (s-k) / 2;
                        if( check(a,b,X) ) break;
                        a = (-s+k) /2;
                        b = (-s-k) /2;
                        if( check(a,b,X) ) break;
                    }
                }
            }
        }

        U = p;
        k = X/p;
        D = 5*(k*k*k*k + 4*U);
        if( D < 0) continue;
        u = static_cast<long long>(sqrt(D));
        if( u*u != D ) continue;

        if( (-5*k*k + u  )%10 == 0 ){
            t = (u-5*k*k) / 10;
            v = k*k + 4*t;
            if(v>=0){
                s = static_cast<long long>(sqrt(v));
                if(s*s == v){
                    if((s+k)%2 == 0){
                        a = (s+k) / 2;
                        b = (s-k) / 2;
                        if( check(a,b,X) ) break;
                        a = (-s+k) /2;
                        b = (-s-k) /2;
                        if( check(a,b,X) ) break;
                    }
                }
            }
        }

        if( (-5*k*k - u  )%10 == 0 ){
            t = (-u-5*k*k) / 10;
            v = k*k + 4*t;
            if(v>=0){
                s = static_cast<long long>(sqrt(v));
                if(s*s == v){
                    if((s+k)%2 == 0){
                        a = (s+k) / 2;
                        b = (s-k) / 2;
                        if( check(a,b,X) ) break;
                        a = (-s+k) /2;
                        b = (-s-k) /2;
                        if( check(a,b,X) ) break;
                    }
                }
            }
        }
        
        U = -p;
        k = -X/p;
        D = 5*(k*k*k*k + 4*U);
        if( D < 0) continue;
        u = static_cast<long long>(sqrt(D));
        if( u*u != D ) continue;

        if( (-5*k*k + u  )%10 == 0 ){
            t = (u-5*k*k) / 10;
            v = k*k + 4*t;
            if(v>=0){
                s = static_cast<long long>(sqrt(v));
                if(s*s == v){
                    if((s+k)%2 == 0){
                        a = (s+k) / 2;
                        b = (s-k) / 2;
                        if( check(a,b,X) ) break;
                        a = (-s+k) /2;
                        b = (-s-k) /2;
                        if( check(a,b,X) ) break;
                    }
                }
            }
        }
        if( (-5*k*k - u  )%10 == 0 ){
            t = (-u-5*k*k) / 10;
            v = k*k + 4*t;
            if(v>=0){
                s = static_cast<long long>(sqrt(v));
                if(s*s == v){
                    if((s+k)%2 == 0){
                        a = (s+k) / 2;
                        b = (s-k) / 2;
                        if( check(a,b,X) ) break;
                        a = (-s+k) /2;
                        b = (-s-k) /2;
                        if( check(a,b,X) ) break;
                    }
                }
            }
        }

        }

    cout << a << " " << b << endl;

    return 0;
}


Measured memory_bytes: 3656