#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (1), _end_ = (9); i <= _end_; ++i)
    for (int j = (1), _end_ = (9); j <= _end_; ++j)
      if (i * j == n) {
        printf("%d %d\n", i, j);
        return 0;
      }
  printf("-1\n");
  return 0;
}
