#include <bits/stdc++.h>
using namespace std;
int n;
long long isp[10000005];
long long primes[1000005];
int cnt;
void init() {
  cnt = 0;
  for (int i = 2; i <= 10000000; i++) {
    if (isp[i] == 0) {
      primes[cnt] = i;
      cnt++;
    }
    for (int j = 0; j < cnt, primes[j] * i <= 10000000; j++) {
      isp[primes[j] * i] = 1;
      if (i % primes[j] == 0) break;
    }
  }
}
long long a[100005];
long long ans[100005];
int check[1000005];
int ff(long long x) {
  long long xx = x;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      if (check[i] == 1) return 0;
      while (x % i == 0) x /= i;
    }
  }
  if (x != 1)
    if (check[x] == 1) return 0;
  x = xx;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) check[i] = 1;
    while (x % i == 0) x /= i;
  }
  if (x != 1) check[x] = 1;
  return 1;
}
int main() {
  init();
  while (~scanf("%d", &n)) {
    memset(check, 0, sizeof(check));
    int f = 0;
    for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
    int sta1 = 2;
    for (int i = 1; i <= n; i++) {
      if (f == 0) {
        int sta2 = a[i];
        while (ff(sta2) == 0) {
          sta2++;
          f = 1;
        }
        ans[i] = sta2;
      } else {
        while (ff(sta1) == 0) {
          sta1++;
        }
        ans[i] = sta1;
        sta1++;
      }
    }
    for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
    printf("\n");
  }
  return 0;
}
