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 Rust (1.42.0) (judge verdict: Accepted)

use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn read_touple<T: std::str::FromStr + Copy>() -> (T, T) {
  let v: Vec<T> = read_vec();
  assert_eq!(v.len(), 2);
  (v[0], v[1])
}

fn main() {
  let x: i64 = read();
  let mut ans = (0, 0);
  let n = 100_00;
  let mut v = vec![0; 2 * n];
  for i in 0..2*n {
    v[i] = pow(i as i64 - n as i64, 5);
  }
  //println!("{:?}", v);

  for a in 0..n {
    let tb = pow(a as i64, 5) - x;
    if let Some(b) = v.binary_search(&tb).ok() {
      println!("{} {}", a, b as i64 - n as i64);
      return
    }
    //println!("{} {} {:?}",a, tb,  v.binary_search(&tb));
  }
}


fn pow(x: i64, n: usize) -> i64 {
  let mut res = 1;
  for i in 0..n {
    res *= x;
  }
  res
}