#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
const int MAX = 20000001;
int p[MAX];
int main()
{
p[0] = 1;
p[1] = 1;
for (int i = 2; i < sqrt(MAX); ++i)
{
for (int k = (MAX - 1) / i, j = k * i; k >= i; --k, j-=i)
{
if (!p[k])
p[j] = 1;
}
}
vector <int> prime;
for (int i = 2; i < MAX; ++i)
{
if (!p[i])
{
prime.push_back(i);
}
}
vector <vector <int> > ans;
for (int i = 0; i < prime.size() - 2; ++i)
{
if (prime[i] + 2 == prime[i + 1])
{
vector <int> temp;
temp.push_back(prime[i]);
temp.push_back(prime[i + 1]);
ans.push_back(temp);
}
}
int S;
while (cin >> S)
{
--S;
cout << "(" << ans[S][0] << ", " << ans[S][1] << ")\n";
}
}