#include <bits/stdc++.h>
using namespace std;
const int M = 15e6;
bool mark[M];
int par[M];
int getpar(int v) { return par[v] == v ? v : par[v] = getpar(par[v]); }
int32_t main() {
  iota(par, par + M, 0);
  int n;
  cin >> n;
  bool fal = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    int v = (fal ? getpar(2) : getpar(x));
    if (v > x) fal = 1;
    for (int u = 2; u * u <= v; u++)
      if (v % u == 0) {
        if (!mark[u])
          for (int k = u; k < M; k += u)
            if (par[k] == k) par[k] = k + 1;
        u = v / u;
        if (!mark[u])
          for (int k = u; k < M; k += u)
            if (par[k] == k) par[k] = k + 1;
        u = v / u;
      }
    for (int k = v; k < M; k += v)
      if (par[k] == k) par[k] = k + 1;
    printf("%d ", v);
  }
  return cout << endl, 0;
}
