#include using namespace std; using ull = unsigned long long; using ll = long long; int main() { ull N; cin >> N; ll num1 = 1; ll num2= 1; ll count = num1*num2; count *= 2; while(count != N && count < N) { if(num2 < num1) ++num2; else ++num1; count = num1*num2*2; } if(count != N) cout << N-1 << ' ' << N-1 << endl; else cout << 1 + (num1-1) + (num2-1) << ' ' << N-1 << endl; }