#include <iostream>
using namespace std;

int main(){
    int N;
    while(1){
        cin>>N;
        if(N==0) break;
        int cur = 0;
        int right = 1;
        int left = 1;

        while(1){
            if(cur < N) cur += right++;
            else if(cur > N) cur -= left++;
            else break; 
        }

        cout<<left<<" "<<right-left<<endl;
    }

    return 0;
}
