#include <stdio.h>

typedef long long ll;

void solve(ll *low, ll *f,ll b) {

ll i;

for (i = 1ll; i <= 100000ll; i += 1ll) {
if ((i*i) - i > 2ll * b) {
break;
}
ll x = -(i*i) + i + (2ll * b);
if (x > 0ll && x % (2ll * i) == 0ll) {
*low = x / (2ll * i);
*f = i;
}
}


}

int main() {

ll low,floor,b;

while (1) {
scanf("%lld",&b);
if (b == 0ll) { break; }
solve(&low,&floor,b);
printf("%lld %lld\n", low, floor);
}

return 0;
}
