#include <bits/stdc++.h>

#define REP(i ,n) for(int i=0 ;i < n; i++)
#define REPB(i ,n) for(int i=n; i >= 0; i--)
#define FOR(i ,m ,n) for(int i=m; i < n; i++)
#define FORB(i, m, n) for(int i=m; i>= n; i--)
#define ll long long
#define pb push_back
#define popb pop_back
#define debug(i) cout << "(i) " <<  i << endl
using namespace std;
int n;
int f, l;
int solve();
int sum(int n){
    return (n * (n + 1) / 2);
  }

int main(){
  cin >> n;
  while(n != 0){
    solve();
    cout << f << " " << l << endl;
    cin >> n;
 }
 return 0;
}

int solve(){
    int st = sqrt(2 * n);
    //cout  << "st " << st << endl;
    int num = st;
    int t = n - sum(st);
    REPB(i,st){
      if(t % num == 0 && t >= 0){
        l = num;
        f = t / num + 1;
        //cout << "sum " <<  sum(num) << endl;
        return 0;
    }
        t += st;
        st--;
        num--;
      }
  }
