import core.stdc.stdio;
void main(){
	int N;
	for(;~scanf("%d",&N)&&N;){
		int head=1,tail=1,s=0;
		for(;;){
			for(;s<N;tail++)s+=tail;
			for(;s>N;head++)s-=head;
			if(s==N){printf("%d %d\n",head,tail-head);break;}
		}
	}
}
