#include <bits/stdc++.h>
int main(void) {
  using namespace std;
  int n, k;
  bool Num[1000000]{0};
  for (int i = 2; i < 1000000; i++) {
    if (!Num[i]) {
      for (int n = i + i; n < 1000000; n += i) {
        Num[n] = !Num[n];
      }
    }
  }
  cin >> n;
  for (int i = 0; i <= n; i++) {
    cin >> k;
    if (Num[i]) {
      cout << i << endl;
    }
  }
  return 0;
}
