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 <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
using namespace std;
// 多倍長テンプレ
/* ---------------------- ここから ---------------------- */
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
/* ---------------------- ここまで ---------------------- */
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
int Gojou(long long int A,long long int B){
  long long int result=A*A*A*A*A;
  result-=B*B*B*B*B;
  return result;
}
int main() {
  int X;
  cin >> X;
  long long int A,B;
  int flag=0;
  long long int a=0,b=0;
  for(long long int i=0;i<=1000000;i++){
    for(long long int j=0;j<i;j++){
      if(Gojou(i,j)==X){
        flag=1;
        a=i;
        b=j;
        break;
      }
      if(Gojou(i,j)>X){
        break;
      }
    }
    if(flag==1){
      break;
    }
  }
  if(a==0){
    for(long long int i=0;i<=1000000;i++){
      for(long long int j=0;j>-1000000;j--){
        if(Gojou(i,j)==X){
          flag=1;
          a=i;
          b=j;
          break;
        }
        if(Gojou(i,j)>X){
          break;
        }
      }
      if(flag==1){
        break;
      }
    }
  }
  if(b==0){
    for(long long int i=0;i>=-1000000;i--){
      for(long long int j=0;j<i;j--){
        if(Gojou(i,j)==X){
          flag=1;
          a=i;
          b=j;
          break;
        }
        if(Gojou(i,j)>X){
          break;
        }
      }
      if(flag==1){
        break;
      }
    }
  }
  //long long int aaa=12;
  //long long int bbb=11;
  //cout << Gojou(aaa,bbb);
  cout << a << " " << b;
  cout << endl;
  return 0;
}