#include <bits/stdc++.h>
using namespace std;
long long su[200005], cnt, n, a[200005], b[200005], ppos = 1;
bool isprime[2000005];
void prime() {
  cnt = 1;
  memset(isprime, 1, sizeof(isprime));
  for (long long i = 2; i <= 2000005; i++) {
    if (isprime[i]) su[cnt++] = i;
    for (long long j = 1; j < cnt && su[j] * i < 2000005; j++)
      isprime[su[j] * i] = 0;
  }
}
int main() {
  prime();
  scanf("%lld", &n);
  for (long long i = 0; i < n; i++) scanf("%lld", &a[i]);
  long long ff = 0;
  for (long long i = 0; i < n; i++) {
    if (ff == 1) {
      while (b[ppos] == 1) {
        ppos++;
      }
      a[i] = su[ppos];
      b[ppos] = 1;
      continue;
    }
    long long flag = 1;
    for (long long j = 1; su[j] <= a[i]; j++) {
      if (a[i] % su[j] == 0 && b[j] == 1) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) {
      long long pos = 1;
      long long s = a[i];
      while (s != 1) {
        if (s % su[pos] == 0) {
          b[pos] = 1;
          while (s % su[pos] == 0) {
            s /= su[pos];
          }
        }
        pos++;
      }
    } else {
      long long ss = a[i] + 1;
      while (ff == 0) {
        long long fg = 1;
        for (long long j = 1; su[j] <= ss; j++) {
          if (ss % su[j] == 0 && b[j] == 1) {
            fg = 0;
            break;
          }
        }
        if (fg == 1) {
          a[i] = ss;
          long long s = a[i], pos = 1;
          while (s != 1) {
            if (s % su[pos] == 0) {
              b[pos] = 1;
              while (s % su[pos] == 0) {
                s /= su[pos];
              }
            }
            pos++;
          }
          ff = 1;
        }
        ss++;
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    if (i != 0) printf(" ");
    printf("%lld", a[i]);
  }
  printf("\n");
  return 0;
}
