#include using namespace std; inline int ctz(int n) { return __builtin_ctzl(n); } inline int ctz(long long n) { return __builtin_ctzll(n); } template vector> factorize(T n) { vector> factors; int c; if ((c = ctz(n)) > 0) { factors.emplace_back(2, c); n >>= c; } T lim = sqrt(n) + 0.1; for (T p = 3; p <= lim; p += 2) { c = 0; while (n % p == 0) { n /= p; c++; } if (c != 0) factors.emplace_back(p, c); } if (n != 1) factors.emplace_back(n, 1); return factors; } template INT_T powi(INT_T b, INT_T x) { if (x == 0) return 1; if (x == 1) return b; if (x & 1) return powi(b*b, x/2) * b; return powi(b*b, x/2); } int main() { int n; cin >> n; vector> factors = factorize(n); int a = 1, b = 1; for (const auto& f : factors) { if (f.second / 2) { a *= powi(f.first, f.second/2); } if (f.second & 1) { b *= f.first; } } cout << a << " " << b << endl; }