#include <bits/stdc++.h>
#define CEIL(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))
using namespace std;

signed main(){
    int n;
    while(true){
        scanf("%d",&n);
        if(!n) break;
        int l = 1, r = 1, sum = 0;
        while(sum!=n){
            if(sum > n){
                sum -= l++;
            }
            if(sum < n){
                sum += r++;
            }
            
        }
        printf("%d %d\n",l,r - l);
    }
    return 0;
}

