#include<iostream>
#include<algorithm>

typedef long long ll;

using namespace std;

int main() {
	while (1) {
		ll b;
		cin >> b;
		if (b == 0)break;
		int n = 0;
		int low = 0, length = 0;
		while ((n + 1) * (n + 1) <= 2 * b) {
			if ((2 * b) % (n + 1) == 0 && ((2 * b) / (n + 1) - n) % 2 == 0) {
				ll a = ((2 * b) / (n + 1) - n) / 2;
				if (length <= n)length = n + 1, low = a;
			}
			n++;
		}
		cout << low << " " << length << endl;
	}
	return 0;
}
