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!(int);
    foreach (A; 0 .. 10^^3+1) foreach (B; 0 .. A+1) {
        if (A^^5 - B^^5 == X) writeln (A, " ", B);
        if (A^^5 + B^^5 == X) writeln (A, " ", -B);
    }
}

