#include #include using namespace std; long long int is_prime(long long int n){ switch(n){ case 0: case 1: return 1; case 2: return -1; } if(n%2 == 0) return 2;//2を返せばおk for(int d = 3; d*d <= n; d+=2){ if(n%d == 0) return d;//dを返せばおk } return -1; } int main(){ long long int m; cin >> m; int p = is_prime(m); if(p == -1){ cout << 1 << " " << m << endl; }//素数なので 1 mを返却する else { cout << p << " " << m/p << endl; } return 0; }