#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main (void){
	ll b;
	while(true){
		cin >> b;
		if(!b) break;
		for(ll n = 100000LL; n > 0LL; --n){
			ll d = b / n - (n - 1LL) / 2LL;
			if(d <= 0LL) continue;
			if(2LL * b == (2LL * d + n - 1LL) * n){
				cout << d << " " << n << endl;
				break;
			}
		}
	}
	return 0;
}
