#include <iostream>
#include<string>
#include<algorithm>
using namespace std;
#define ll long long
ll b;
ll MA=50000;
ll f(ll a,ll b){

    return (b*(b+1LL)/2LL)-(a*(a-1LL)/2LL);
}

void solve(ll b){

    for(ll i=MA;i>=1;i--){
        ll ng=0,ok=1000000000+6;
        ll mid;
        
        while(abs(ok-ng)>1){
            mid=(ok+ng)/2;
            
            if(f(mid,mid+i-1)==b)break;
            
            if(f(mid,mid+i-1)>b){
                ok=mid;
            }
            else{
                ng=mid;
            }
        }
        //cout<<ok<<" "<<i<<endl;
        if(f(mid,mid+i-1)==b){
            cout<<mid<<" "<<i<<endl;
            return;
        }
    }
}

int main(void){
    while(cin>>b,b){
        solve(b);
    }
}

