#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n)
{
if(n == 1 || n == 0 || n < 0)return false;
for(int i = 2; i <= sqrt(n); i++)
{
if(n % i ==0)
return false;
}
return true;
}
int main(){
int n;
while(cin >> n){
for(int i = 2;i < n;i ++){
if(isPrime(i) && i % 10 == 1)cout << i << " ";
}
cout << endl;
}
return 0;
}

京公网安备 11010502036488号