#include <bits/stdc++.h>
using namespace std;
vector<long long> primes;
bool vis[20000000];
vector<long long> a, b;
long long v[20000000];
void genp() {
  for (long long i = 2; i < 20000000; i++) {
    if (!vis[i]) {
      primes.push_back(i);
      for (long long j = 1; j * i < 20000000; j++) vis[j * i] = 1;
    }
  }
}
void mark(long long x) {
  for (long long i = 2; i <= sqrt(x); i++) {
    long long z = i;
    if (x % z == 0) {
      long long f = x / z;
      for (long long j = 1; j * z < 20000000; j++) v[j * z] = 1;
      for (long long j = 1; j * f < 20000000; j++) v[j * f] = 1;
    }
  }
  long long z = x;
  for (long long j = 1; j * z < 20000000; j++) v[j * z] = 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  genp();
  v[0] = 1;
  v[1] = 1;
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a.push_back(x);
  }
  bool ok = 0;
  long long s = 2;
  for (long long i = 0; i < n; i++) {
    if (!ok) {
      long long x = a[i];
      if (!v[x]) {
        b.push_back(x);
        mark(x);
      } else {
        ok = 1;
        for (long long k = x + 1; k <= 1e9; k++) {
          if (!v[k]) {
            b.push_back(k);
            mark(k);
            break;
          }
        }
      }
    } else {
      for (s = s; s <= 1e9; s++) {
        if (!v[s]) {
          b.push_back(s);
          mark(s);
          break;
        }
      }
    }
  }
  for (long long i = 0; i < n; i++) cout << b[i] << " ";
  cout << endl;
}
