Problem:
Score : 400 points

Problem Statement

Give a pair of integers (A, B) such that A^5-B^5 = X.
It is guaranteed that there exists such a pair for the given integer X.

Constraints

1 \leq X \leq 10^9

X is an integer.

There exists a pair of integers (A, B) satisfying the condition in Problem Statement.

Input

Input is given from Standard Input in the following format:

X

Output

Print A and B, with space in between.
If there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.

A B

Sample Input 1

33

Sample Output 1

2 -1

For A=2 and B=-1, A^5-B^5 = 33.

Sample Input 2

1

Sample Output 2

0 -1

Solution in C++ (GCC 9.2.1) (judge verdict: Wrong Answer)

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define fo(i,start,end) for(int i=start;start<end?i<end:i>end;start<end?i+=1:i-=1)
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define F first
#define S second
#define vll vector<ll>
#define pll pair<ll,ll>
#define vop vector<pll>
#define vov vector<vector<ll>>
using namespace std;
const ld pi=3.14159265358979323;

const long long mod1=1e9+7;
const long long mod2=1e18;
const ll mod3=9e18;

long long power(ll  x, ll n){if(n==0)return 1;ll temp=power(x,n/2);if(n%2==0)return temp*temp;else return x*temp*temp;}
ll MAX(ll a,ll b){return a>b?a:b;}
ll MAX(ll a,ll b,ll c){return max(max(a,b),c);}
ll MIN(ll x,ll  y){return x+y-max(x,y);}
ll MIN(ll x,ll y,ll z){return min(min(x,y),z);}
void swap(int* a, int* b){int t = *a;*a = *b;*b = t;}
bool f(ll x,ll y){return x>y;}

ll pmod(ll a, ll b)//a^b%mod1
{
    ll ans=1;
    while(b)
    {
        if(b&1)
            ans=(ans*a)%mod1;
        b/=2;
        a=(a*a)%mod1;
    }
    return ans;
}




vll adj[100001];
ll vis[100001];
ll sssp[100001];






void solve(){
    ll x;
    cin>>x;
    ll s=0;
    ll e=x+1;
    while(s<e){
        ll m=(s+e)/2;
        ll t=5*(m-1)*m*(m*m+1-m);

        if(t>x-1)e--;
        if(t<x-1)s++;
        if(t==x-1){

            cout<<t<<" "<<t-1;
return;

        }






    }

}




int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt" , "r" , stdin) ;
    freopen("output.txt" , "w" , stdout) ;
    //freopen("error.txt" , "w" , stderr) ;
#endif

    ll t;
    t=1;
    //cin>>t;
    while(t--){

        solve();
    }

    return 0;


}