#include <iostream>
#include <cmath>
#include <fstream>
using namespace std;
int main() {
fstream inputF("power.in.txt");
int x;
inputF >> x;
inputF.close();
int a = 0, b = 0;
fstream outputF("power.out.txt");
while (a <= x && b <= x) {
a == x ? a = 0, b++ : a++;
if (pow(a, b) == x) {
outputF << a << ' ' << b << endl;
}
}
return 0;
}