#include <bits/stdc++.h>
using namespace std;
using cd = complex<double>;
const double pi = acos(-1);
vector<long long> ft(1, 1LL);
vector<int> vis(5e6, 0);
void solve() {
  int n, f = 0, ff = 0;
  cin >> n;
  vector<int> ans;
  int z;
  for (long long i = 0; i < n; i++) {
    int x;
    if (f)
      x++;
    else
      cin >> x;
  next:
    vector<int> temp;
    int z = x;
    for (int j = 2; j * j <= z; j++) {
      if (z % j == 0) {
        if (vis[j]) {
          x++;
          f = 1;
          goto next;
        } else
          temp.push_back(j);
      }
      while (z % j == 0) z /= j;
    }
    if (z != 1) {
      if (vis[z]) {
        x++;
        f = 1;
        goto next;
      } else
        temp.push_back(z);
    }
    ans.push_back(x);
    for (auto i : temp) vis[i] = 1;
    if (f and !ff) ff = 1, x = 1;
  }
  for (auto i : ans) cout << i << " ";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
