#include <bits/stdc++.h>
int a, h = 0, i, c;
int b(int c) {
for (int j = 1; j <= c; j++) {
if (j % c == 0) {
h++;
}
if (h >= 3) {
return 3;
}
return h;
}
}
using namespace std;
int main() {
cin >> a;
for (int i = pow(10, a); i < pow(10, a); i++) {
c = i;
if (b(c) == 2) {
c = c / 10;
h = 0;
if (b(c) == 2) {
c = c / 10;
h = 0;
if (b(c) == 2) {
c = c / 10;
h = 0;
if (b(c) == 2) {
h = 0;
cout << i;
}
}
}
}
}
}