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



int main() {
	int i, j, k;
	int m, n;
	int f = 0;
	int g = 0;
	int x;
	int a, b, c;

	scanf("%d", &x);

	if (x == 1) {
		a = 0;
		c = 1;
		goto finn;
	}
	else if (x == -1) {
		a = 0;
		c = -1;
		goto finn;
	}
	for (i = 10;i < x;i = i + 10) {
		if (x % (i + 1) == 0) {
			c = x / (i + 1);
			m = i / 5;
			for (j = 0;j < sqrt(m) + 1;j++) {
				if (m == (j*j*j*j + 2 * j*j*j*c + 2 * j*j*c*c + j * c*c*c)) {
					a = j;
					goto finn;
				}
				else if (m == (j*j*j*j - 2 * j*j*j*c + 2 * j*j*c*c - j * c*c*c)) {
					a = -j;
					goto finn;
				}
			}
		}
	}
	finn:
	b = a - c;

	printf("%d %d", a, b);


	return 0;
}