#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int x;
    cin >> x;
    ll r;
    for(int a = 1;a <= 1000;a++){
        for(int b = 1;b <= 1000;b++){
            r = a*a*a*a*a-b*b*b*b*b;
            if(r == x){
                cout << a <<" "<< b << "\n";
                exit(0);
            }
        }
    }
}