#include<std/c++.h>
using namespace std;
#define ll long long
ll n;
int main()
{
	while (1) {
		scanf("%d", &n);
		if (n == 0)break;
		ll st = min(n, (ll)1e5);
		for (ll i = st; i >= 1; i--)
		{
			if ((n * 2 - (1 + i)*i>=0)&&(n * 2 - (1 + i)*i + 2 * i) % (2 * i) == 0)
			{
				printf("%lld %lld\n", ((n*2 - (1 + i)*i) / (2 * i)) + 1, i);
				break;
			}
		}
	}
	system("pause");
	return 0;
}
