#include <bits/stdc++.h>
using namespace std;
int main(){
long long num,x,y,z;
cin >> num;
x = num % 3;
y = num % 5;
z = num % 7;
if (x == 0){
if (y == 0){
if (z == 0){
cout << "3 5 7";
}else{
cout << "3 5";
}
}else{
cout << "3";
}
}else{
if (y == 0){
if (z == 0){
cout << "5 7";
}else{
cout << "5";
}
}else{
if (z == 0){
cout << "7";
}else{
cout << "n";
}
}
}
return 0;
}