#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(obj) obj.begin(), obj.end()

const int iINF = 1e9;
const long long llINF = 1e18;
const int MOD = 1e9 + 7;

using namespace std;

template <typename T>
int getFormer(const vector<T> &vec, T x) {
    return upper_bound(vec.begin(), vec.end(), x) - vec.begin() - 1;
}

template <typename T>
int getLatter(const vector<T> &vec, T x) {
    return lower_bound(vec.begin(), vec.end(), x) - vec.begin();
}

void solve(long long b) {
    for (int k = 1e5; k > -1; k--) {
        if (2 * b % k != 0) continue;
        long long n = 2 * b / k - (k - 1);
        if (n < 1 || n % 2 != 0) {
            continue;
        }
        cout << n / 2 << " " << k << endl;
        break;
    }
}

int main() {
    long long b;
    while (cin >> b && b) {
        solve(b);
    }
}
