#include<bits/stdc++.h>
using namespace std;
using LL=long long;
#define IOS ios :: sync_with_stdio(false);

const int N = 1e3 + 10;

bool isprime(int x){
    for(int i=2;i<=sqrt(x);i++){
        if(x%i==0)
        return false;
        
    } 
    return true;
    
}
bool hw(int x){
     int q=x%10*10+x/10;
     if(isprime(q)){
        return true;
     }
     return false;
     
     
}
int main(){
    for(int i=;i<=;i++){
        if(isprime(i)&&hw(i)) cout<<i<<'\n';
    }
    
    return 0;
}