#include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<queue>
#include<map>
#include<stack>
#include<vector>
#include<limits>
#include<numeric>
using namespace std;
long long n;
int main()
{
    while(scanf("%lld",&n) && n!=0)
    {
    	for(long long s=50000;s>=1;s--)
    	{
    		long long i=2*n+s-s*s;
    		i/=2*s;
    		if(s*(s-1+2*i)==2*n && s>0 && i>0)
    		{
    			printf("%lld %lld\n",i,s);
    			break;
    		}
    	}
    }
	return 0;
}
