#include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
int cot=0;
for(int x=1;x*x<=n;x++){
for(int y=x;x<=y;y++){
if(x*x+y*y==n){
printf("\n%d %d",x,y);
cot=1;
}
}
}
if(cot==0){
printf("No Solution");
}
return 0;
}