#include <stdio.h>

int main(){
    long int x;
    long int a, b = -1;

    scanf("%ld", &x);

    for(long int i = 0; i <= x; i++){
            if(i*i*i*i*i + 1 == x){
                a = i;
                break;
            }
    }
    printf("%ld %ld", a, b);
}