#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,row,col,row_or_col,from,to;
double store;
while(scanf("%lld",&n)&&n)
{
store = n;
row_or_col = ceil(sqrt(store));
from = row_or_col-1;
from = (from*from)+1;
to = from-1+row_or_col;
if(row_or_col%2==0)
{
if(n>=from && n<=to)
{
row = row_or_col;
col = (n-from)+1;
}
else
{
col = row_or_col;
row = (row_or_col*row_or_col)-n+1;
}
}
else
{
if(n>=from && n<=to)
{
col = row_or_col;
row = (n-from)+1;
}
else
{
row = row_or_col;
col = (row_or_col*row_or_col)-n+1;
}
}
printf("%lld %lld\n",col,row);
}
return 0;
}