#include <iostream>
#include <stdio.h>

using namespace std;

int main(){
	while(1){
		int b;
		scanf("%d", &b);
		//scanf("%d", &b) // AOJではscanf_s()が使えないことに注意
		if(!b) break;
		int high=1, low=1, sum=1;
		while(1){
			if(sum == b) break;
			else if(sum < b){
				high++;
				sum += high;
			} else{
				sum -= low;
				low++;
			}
		}
		int ans1 = low; //借りるフロアの中での最下層
		int ans2 = high - low + 1; //借りるフロアの総数
		printf("%d %d\n", ans1, ans2);

		//cout << low << " " << high-low+1 << endl;
	}
	return 0;
}
