import std.stdio, std.string, std.conv;
import std.typecons;
import std.algorithm, std.array, std.range, std.container;
import std.math;

void main() {
    auto X = readln.split[0].to!(long);
    foreach (A; 0 .. 10^^3+1) foreach (B; 0 .. A) {
        if (A^^5 - B^^5 == X) { writeln (A, " ", B); return; }
        if (A^^5 + B^^5 == X) { writeln (A, " ", -B); return; }
    }
    assert(0);
}

