function D166(_input) {
    var lines = _input.split("\n");
    var x = lines.shift()*1;

    for (var i = 117; i > -118; i--) {
        for (var j = 116; j > -117; j--) {
            const fi = i*i*i*i*i;
            const fj = j*j*j*j*j;
            if (fi - fj === x) {
                console.log(`${i} ${j}`);
                return;
            }
        }
    }
}
D166(require("fs").readFileSync("/dev/stdin", "utf8"));