#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  long long a = 0;
  long long b = 0;
  long long sum = 1000000000000;
  cin >> N;
  for (int i = 1; i <= N; i++) {
    if (((N / i) < 10) && (N % i == 0)) {
      if ((i + N / i) <= sum) {
        a = i;
        b = N / i;
        sum = a + b;
      }
    }
  }
  cout << a << ' ' << b << endl;
  cout << a + b - 2 << endl;
  return 0;
}
