#include<stdio.h> 
#include<math.h>

int main() {
	int x,a,b,t;
	scanf("%d",&x);
	for(double i = pow(x,0.2);i > 0;i --) {
		int j = (int)i;
		if(x % j == 0) {
			t = j;
			break;
		}
	} 
	for(int i = 1;i < 100;i ++) {
		if(pow(i,5) - pow(i-t,5) == x) {
			a = i;
			b = i - t;
			break;
		}
	}
	if(a == 0) {
		for(int j = 1;j <= pow(x,0.5);j ++) {
			if(x % j == 0) {
				t = j;
				for(int i = 1;i < 100;i ++) {
					if(pow(i,5) + pow(i-t,5) == x) {
						a = i;
						b = t - i;
						goto here;
					}
				}
			}
			
		} 
		
	}
	here:
	printf("%d %d",a,b);
}