#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int x=0;
while(x!=2)
{
int z=n-1;
bool ok=0;
if(z<2)
ok=1;
else if(z==2)
ok=0;
else if(z%2==0)
ok=1;
else for(int d=3; d*d<=z; d+=2)
if(z%d==0)
ok=1;
if(ok==0)
{
cout<<z<<" ";
x++;
}
n--;
}
}