#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=998244353;
const LL LINF=1LL<<62;
const LL INF=1<<28;



int main(){
    int b;
    while(cin >> b){
        if(!b) break;
        for (int k = (int)sqrt(2*b); k > 0 ;k--) {
            if((2*b-k*k+k)%(2*k)==0){
                cout << (2*b-k*k+k)/2/k << " " << k << endl;
                break;
            }
        }
    }
    return 0;
}


