宏唯爛
#include<iostream>
#include<cmath>
using namespace std;
int main() {
int n;
while (cin >> n, n != 0) {
int x = sqrt(n);
int step = n - x*x;
if (x % 2 == 0) {
if (step == 0) cout << x << " 1" << endl;
else if (step <= x+1) cout << x+1 << " " << step << endl;
else cout << x+x+2-step << " " << x+1 << endl;
} else {
if (step == 0) cout << "1 " << x << endl;
else if (step <= x+1) cout << step << " " << x+1 << endl;
else cout << x+1 << " " << x+x+2-step << endl;
}
}
}