#include <bits/stdc++.h>
using namespace std;
const int N = 1e7 + 100;
int mod = 1e9 + 7;
namespace NT {
int fact[N], inv[N];
int bm(int b, int p, int m) {
  if (p == 0) return 1 % m;
  int t = bm(b, p / 2, m);
  t = (1ll * t * t) % m;
  if (p & 1) return 1ll * t * b % mod;
  return t;
}
int C(int n, int r) {
  if (n < 0 or r < 0 or r > n) return 0;
  int ret = 1ll * fact[n] * inv[r] % mod;
  ret = 1ll * ret * inv[n - r] % mod;
  return ret;
}
void init() {
  fact[0] = 1;
  for (int i = 1; i < N; i++) {
    fact[i] = 1ll * fact[i - 1] * i % mod;
  }
  inv[N - 1] = bm(fact[N - 1], mod - 2, mod);
  for (int i = N - 2; i >= 0; i--) {
    inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
  }
}
bool composite[N];
vector<int> prime;
void sieve() {
  composite[1] = 1;
  for (int i = 2; i < N; i++) {
    if (!composite[i]) prime.push_back(i);
    for (int j = 0; j < prime.size() && prime[j] * i < N; j++) {
      composite[prime[j] * i] = 1;
      if (i % prime[j] == 0) break;
    }
  }
}
}  // namespace NT
bool used[N];
bool okay(int x) {
  vector<int> p;
  for (int i = 2; i * i <= x; i++) {
    int c = 0;
    while (x % i == 0) {
      x /= i;
      c++;
    }
    if (c > 0 && used[i]) return 0;
    if (c > 0) p.push_back(i);
  }
  if (x > 1) {
    if (used[x]) return 0;
    p.push_back(x);
  }
  for (int x : p) used[x] = 1;
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  NT::sieve();
  int n;
  cin >> n;
  vector<int> v(n), res;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  bool eq = 1;
  for (int i = 0; i < n; i++) {
    if (okay(v[i])) {
      res.push_back(v[i]);
    } else {
      for (int x = v[i] + 1; x < N; x++) {
        if (okay(x)) {
          res.push_back(x);
          break;
        }
      }
      for (int i = 0; i < NT::prime.size(); i++) {
        if (res.size() == n) break;
        int p = NT::prime[i];
        if (used[p]) continue;
        res.push_back(p);
      }
      for (int x : res) {
        cout << x << " ";
      }
      exit(0);
    }
  }
  for (int x : res) {
    cout << x << " ";
  }
  return 0;
}
