#include<iostream>
using namespace std;
long n;
int main()
{
	while(cin>>n,n)
	{
		for(long w=1e5;--w;)
		{
			if(n>w*(w-1)/2&&(n-w*(w-1)/2)%w<1)
			{
				cout<<(n-w*(w-1)/2)/w<<" "<<w<<endl;
				break;
			}
		}
	}
}

