#include <bits/stdc++.h>
bool mark[60000];
int prime[1001];
int size;
void init() {
  size = 0;
  for (int i = 2; i < 60000; i++) {
    if (mark[i] == false) {
      prime[size++] = i;
      for (int j = i * i; j < 60000; j += i) {
        mark[j] = true;
      }
    }
  }
  return;
}
using namespace std;
int main() {
  int ans[60];
  init();
  for (int i = 0; i < size; i++) {
    printf("%d ", prime[i]);
  }
  printf("\n");
  int n;
  while (scanf("%d", &n) != EOF) {
    int i = 0;
    for (int j = 0; j < size; j++) {
      if (prime[j] % 5 == 1) ans[i++] = prime[j];
      if (i == n) break;
    }
    for (int k = 0; k < n; k++) {
      printf("%d ", ans[k]);
    }
    printf("\n");
  }
  return 0;
}
