#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main() {
    long long x;
    while (cin >> x, x) {
        long long n_max = (-1 + sqrt(1 + 8 * x)) / 2;
        for (int n = n_max; n > 0; n--) if (2 * x % n == 0) {
            long long a2 = 2 * x / n - n + 1;
            if (a2 > 0 && a2 % 2 == 0) {
                cout << a2 / 2 << " " << n << endl;
                break;
            }
        }
    }
    return 0;
}
