/*
#include<stdio.h>
int main()
{
int a,b,c=0,i;
scanf("%d %d",&a,&b);
for(i=a;i<=b;i++){
if(i%2==0){
c=c-i;
}
else{
c=c+i;
}
}
printf("%d",c);
}
*/
/*
#include<stdio.h>
int main()
{
int i,a,b,c=0;
scanf("%d %d",&a,&b);
for(i=a;i<=b;i++){
if(i%2==0){
c=c-i;
printf("-%d",i);
}
else{
c=c+i;
printf("+%d",i);
}
}
printf("=%d",c);
}
*/
/*
#include<stdio.h>
int main()
{
int i,a,b,c=0;
scanf("%d %d",&a,&b);
if(a%2==0){
c=c-a;
printf("-%d",a);
}
else{
c=c+a;
printf("%d",a);
}
for(i=a+1;i<=b;i++){
if(i%2==0){
c=c-i;
printf("-%d",i);
}
else{
c=c+i;
printf("+%d",i);
}
}
if(c>0){
printf("=+%d",c);
}
else if(c<0){
printf("=%d",c);
}
else{
printf("=%d",c);
}
}
*/
#include<stdio.h>
int main()
{
int i,n,k,t;
scanf("%d",&n);
for(i=1; ; i++){
if(i*i>n){
k=n-((i-1)*(i-1));
printf("%d %d",k,i-1);
break;
}
}
}