#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define rep(i, j, k) for (auto i = j; i < k; i++)
#define rrep(i, j, k) for (auto i = j; i > k; i--)
using namespace std;

void solve(ll &n) {
  rrep(len, 100000LL, 0LL) {
    ll tmp = n - len * (len - 1) / 2;
    if (tmp <= 0) continue;
    if (tmp % len == 0) {
      ll a = tmp / len;
      cout << a << " " << len << endl;
      return;
    }
  }
}

int main() {
  ll n;
  while (cin >> n, n) solve(n);
}

