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: Accepted)

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
ll mod=1e9+7;
     
ll ceil1(ll n,ll k){
    if(n%k) return n/k+1;
    return n/k;
}
     
ll pow1(ll n,ll k){
        ll ans=1;
        while(k!=0){
            if(k%2) ans=(ans*n)%mod;
            n=(n*n)%mod;
            k=k/2;
        }
        return ans;
}

bool ispal(string s){
    ll i=0;
    ll j=s.size()-1;
    while(i<j){
        if(s[i]!=s[j]) return false;
        i++;
        j--;
    }
    return true;
}

ll gcdd(ll a,ll b){
    if(b==0) return a;
    return gcdd(b,a%b);
}

ll fact(ll n){
    if(n==1 || n==0) return 1;
    else return (n*fact(n-1))%mod;
}

bool isprime(ll n) 
{ 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
  
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (ll i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
}

void solve(){
	ll x;
	cin>>x;
	vector<ll> a;
	for(ll i=-150;i<=150;i++){
		a.push_back(i*i*i*i*i);
	}
	ll ansa,ansb;
	for(ll i=0;i<a.size();i++){
		for(ll j=0;j<a.size();j++){
			if((a[i]-a[j])==x){
				ansa=a[i];
				ansb=a[j];
			}
		}
	}
	ll ta,tb;
	for(ll i=-150;i<=150;i++){
		if(i*i*i*i*i==ansa) ta=i;
	}
	for(ll i=-150;i<=150;i++){
		if(i*i*i*i*i==ansb) tb=i;
	}
	cout<<ta<<" "<<tb<<endl;
	return;
}
	
int main(){    
      ios_base::sync_with_stdio(false);
      cin.tie(0);
      cout.tie(0);
      ll q=1;
      //cin>>q;
      while(q--){
        solve();
      }
      return 0;
}