#include <stdio.h>
#include <math.h>
int main()
{
    int x;
    scanf("%d", &x);
    int a, b, f = 0;
    int aa, bb;
    for (a = 1;; a++)
    {
        aa = a * a * a * a * a;
        for (b = 0; b < a; b++)
        {
            bb = b * b * b * b * b;
            if (aa + bb == x)
            {
                f = -1;
                break;
            }
            else if (aa - bb == x)
            {
                f = 1;
                break;
            }
        }
        if (f != 0)
        {
            break;
        }
    }
    printf("%d %d", a, f * b);
    return 0;
}