#include<stdio.h>

int main(void) {
  int x,a,b,count,c,t;
count=0;
b=0;
x=0;
c=0;
t=1;
  scanf("%d",&x );

    for (a=0;c!=t; a++) {
      for (b=-a+1;a!=b;b++) {
      if (x%(a-b)==0) {
        t=x/(a-b);
      c= a^4+(a^3)*b+(a^2)*(b^2)+a*(b^3)+b^4;
      if (c==t) {
        printf("%d %d", a,b );
      }
      }
      }
    }



  return 0;
}
