#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    while(1){
        int b;
        cin >> b;
        if(b == 0) break;

        int n;
        for(long long int i=1; ; i++){
            if(i*(i+1)/2 > b){
                n = i-1;
                break;
            }
        }
        int ansl, ansn;
        for(int i=n; i>0; i--){
            if(i%2 == 0){
                if(b%(i/2) == 0 && 2*b/i %2 == 1){
                    ansl = b/i -i/2 +1;
                    ansn = i;
                    break;
                }
            }else{
                if(b%i == 0){
                    ansl = b/i -i/2;
                    ansn = i;
                    break;
                }
            }
        }
        cout << ansl << " " << ansn << endl;
    }
    return 0;
}

