#include<iostream> #include<cstdio> #include<vector> using namespace std; const int MAXN=10001; bool isPrime[MAXN]; void Select(vector<int> &prime){ for(int i=0;i<MAXN;++i){ isPrime[i]=true; } isPrime[0]=isPrime[1]=false; for(int i=2;i<MAXN;++i){ if(isPrime[i]){ prime.push_back(i); for(int j=i*i;j<MAXN;j+=i){ isPrime[j]=false; } } } } int main(){ int n; vector<int> prime; Select(prime); while(scanf("%d",&n)!=EOF){ int flag=0; for(int i=0;i<prime.size()&&prime[i]<n;++i){ if(prime[i]%10==1){ printf("%d ",prime[i]); flag=1; } } if(!flag){ printf("-1"); } printf("\n"); } return 0; }