#include <bits/stdc++.h>
using namespace std;
long int gcd(long int a, long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long int lcm(long int a, long int b) { return (a * b) / gcd(a, b); }
int main() {
  long long int N, max1 = 9999, max2 = 9999, s1, s2;
  cin >> N;
  for (long int i = 1; i <= N; i++) {
    int j = N / i;
    if (lcm(i, j) == N) {
      s1 = i;
      s2 = j;
    } else if (lcm(i, N) == N) {
      s1 = i;
      s2 = j;
    }
    if (s1 + s2 < max1 + max2) {
      max1 = s1;
      max2 = s2;
    }
  }
  cout << max1 << " " << max2;
  return (0);
}
