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 <iostream>
#include <cmath>
#include <string.h>
#include <iomanip>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <tuple>
#include <queue>
using namespace std;

typedef long long ll;

#define INF 100000000;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rrep(i, n) for (ll i = n - 1; i >= 0; i--)
#define eps 1.0e-14;

ll fif(ll x){
	return x * x * x * x * x;
}

int main(){
	ll x; cin >> x;
	long double fifth = powl(x,(1.0 / 5.0));
	fifth = floorl(fifth);
	// ll amari = (-1 * x) + fif(fifth);
	// bool minus = false;
	// if(amari < 0){
	// 	amari *= -1;
	// 	minus = true;
	// }
	// amari = powl(amari,1.0/5.0);
	// if(minus){
	// 	amari *= -1;
	// }
	int ans;
	rep(i,64){
		int f = fif(i);
		if(fif(fifth) + f == x) ans = (-1) * i;
		else if (fif(fifth) + (-1) * f == x) ans = i;
	}
	cout << fifth << " " << ans << endl;
	return 0;
}