#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#define forn(i, n) for (int i = 0; i < (int)(n); i++)
#define ABS(A) ((A) > 0 ? (A) : -(A))
typedef long long ll;
const int maxc = 500010;
ll n, x[maxc];
ll Mul( ll a, ll b, ll m )
{
ll k = ((long double)a * b) / m;
ll r = a * b - k * m;
while (r < 0) r += m;
while (r >= m) r -= m;
return r;
}
ll next( ll x )
{
return (Mul(x, x, n) + 3) % n;
}
ll gcd( ll a, ll b )
{
return b ? gcd(b, a % b) : a;
}
void Slow( int n )
{
for (int i = 2; i * i <= n; i++)
if (n % i == 0)
{
printf("%d %d\n", i, n / i);
exit(0);
}
puts("IMPOSSIBLE");
exit(0);
}
int main()
{
freopen("pollard.in", "r", stdin);
freopen("pollard.out", "w", stdout);
scanf("%I64d", &n);
if (n <= (int)1e6)
Slow(n);
ll C = 2 * pow(n, 1.0 / 4);
forn(cnt, 4)
{
x[0] = rand() % (n - 1) + 1;
forn(i, C)
x[i + 1] = (Mul(x[i], x[i], n) + 3) % n;
forn(i, C)
{
ll g = gcd(ABS(x[i] - x[C]), n);
if (g != 1 && g != n)
{
printf("%I64d %I64d\n", g, n / g);
return 0;
}
}
}
puts("IMPOSSIBLE");
return 0;
}