//qf
#include <bits/stdc++.h>
#define f(i,j,n) for(register int i=j;i<=n;i++)
using namespace std;
typedef long long ll;
inline ll read() {
ll x=0;
int f=1;
char ch=getchar();
while(!isdigit(ch)) {
if(ch=='-') f=-1;
ch=getchar();
}
while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch-48),ch=getchar();
return x*f;
}
int n=read();
signed main() {
if(n%3==0) putchar('3'),putchar(' ');
if(n%5==0) putchar('5'),putchar(' ');
if(n%7==0) putchar('7'),putchar(' ');
if(n%3 and n%5 and n%7) putchar('n');
puts("");
return 0;
}