#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
using namespace std;
template <class T>
inline void sort(T &a) {
  sort((a).begin(), (a).end());
}
template <class T>
inline void rsort(T &a) {
  sort((a).rbegin(), (a).rend());
}
template <class T>
inline void reverse(T &a) {
  reverse((a).begin(), (a).end());
}
template <class T, class U>
inline void checkmin(T &x, U y) {
  if (x > y) x = y;
}
template <class T, class U>
inline void checkmax(T &x, U y) {
  if (x < y) x = y;
}
vector<bool> used;
vector<int> mind;
bool check(int n) {
  while (n > 1) {
    if (used[mind[n]]) return false;
    n /= mind[n];
  }
  return true;
}
void add(int n) {
  while (n > 1) {
    used[mind[n]] = true;
    n /= mind[n];
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(20);
  srand(time(nullptr));
  int N = 2e6;
  mind = vector<int>(N);
  for (int i = 2; i < N; ++i)
    for (int j = i; j < N; j += i)
      if (mind[j] == 0) mind[j] = i;
  int n;
  cin >> n;
  vector<int> arr(n);
  for (auto &i : arr) cin >> i;
  used = vector<bool>(N);
  bool flag = false, change = false;
  int past;
  for (auto &i : arr) {
    if (flag) i = past + 1;
    while (!check(i)) {
      ++i;
      ++past;
      flag = true;
    }
    add(i);
    if (flag && !change) change = true, past = 1;
  }
  for (auto i : arr) cout << i << ' ';
  return 0;
}
