#include<bits/stdc++.h>   
using namespace std;      
int main(){
    long long b;
    while(true){
        cin >> b;
        if (b==0)return 0;
        long long now,count,temp;
        now = 1,count=1;
        long long token=b;
        for(long long i = 2;i<1000000000;i++){
            now += i;
            while(now>b){
                now -= count;
                count++;
            }
            if(now == b){
                cout << count << " " << i - count +1 << endl;
                break; 
            }
            
        }
    }
}
