#include <stdio.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=l;i<r;i++)

int main(){
	ll n;
	while(scanf("%lld",&n),n){
		n*=2;
		ll k=sqrt(n);
		if(k*k==n)k--;
		while(n%k||k%2==(n/k)%2)k--;
		ll x=(n/k-(k-1))/2;
		printf("%lld %lld\n",x,k);
	}
}
