"use strict";
    
// 固有の素因数の発見（多分高速）
const getUniqueFactorsFor = num => {
  let results = [1];

  for(let i=2; i*i<=num; i++) {
      if(num % i === 0) {
          results.push(i);
          
          while(num%i === 0) {
            num /= i;
          }
      }
  }

  if(num !== 1) {
    results.push(num);
  }

  return results;
}

// 素因数の配列を返す
function primeFactorization(n){
    n = Math.floor(n);
    var a = [];
    var cnt = 0;
    for(var i=2; i<n; i++){
        if(0 === n%i){
            a[cnt++] = i;
        }
    }
    return a;
}

// 素因数の配列を返す(要素？側)
function primeFactorization2(n) {
    var result = [];

    if (n === 1) {
        return [1];
    }

    var init = 2;

    while ( n !== 1 ) {
        var i = init;
        while (i < Number.MAX_SAFE_INTEGER) {
            if (n % i == 0) {
                result.push(i)
                n /= i;
                break;
            }
            i++;
        }
        init = i;
    }
    
    return result;
}

const main = arg => {
    arg = arg.trim().split("\n");
    const X = parseInt(arg[0].split(" ")[0]);
    
    const temp = primeFactorization2(X);
    const tempLen = temp.length;
    
    let factors = [];
    let now = temp[0];
    
    for(let i=1; i<tempLen; i++) {
        if(temp[i] === temp[i-1]) {
            now = temp[i-1] * temp[i];
        } else {
            factors.push(now);
            now = temp[i];
        }
    }
    
    factors.push(now);
    
    const N = factors.length;
    
    for(let i=0; i<N; i++) {
        for(let j=0; j<factors[i]; j++) {
            const a = j;
            const b = - (factors[i] - a);
            
            // console.log("a:" + a);
            // console.log("b:" + b);
            
            let formula = (a - b) * (Math.pow(a, 4) + Math.pow(a, 3) * b + Math.pow(a, 2) * Math.pow(b, 2) + a * Math.pow(b, 3) + Math.pow(b, 4));
            
            if(formula === X) {
                console.log(a + " " + b);
                return;
            }
        }
    }
    
    console.log(factors);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));