#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 num3 = 1; ll count = num1*num2*num3; while(count != N && count < N) { if(num1 == num3) ++num1; else if(num2 == num3) ++num2; else ++num3; count = num1*num2*num3; } if(count != N) cout << N-1 << ' ' << N-1 << endl; else cout << (num1-1) + (num2-1) + (num3-1) << ' ' << N-1 << endl; }