#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5, MAXM = 1e6 + 5;
int n;
int a[MAXN], b[MAXN];
set<int> banned;
int limit;
bool check(int x) {
  limit = sqrt(x);
  for (int i = 1; i <= limit; i++) {
    if (x % i == 0) {
      if (banned.count(i) == true) return false;
      if (banned.count(x / i) == true) return false;
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int index;
  bool ready = false;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    if (ready == false) {
      index = a[i];
    }
    while (true) {
      if (check(index) == true) {
        b[i] = index;
        break;
      }
      index++;
    }
    if (b[i] > a[i]) {
      if (ready == false) {
        index = 2;
      }
      ready = true;
    }
    limit = sqrt(b[i]);
    for (int j = 2; j <= limit; j++) {
      if (b[i] % j == 0) {
        banned.insert(j);
        banned.insert(b[i] / j);
      }
    }
    banned.insert(b[i]);
  }
  for (int i = 0; i < n; i++) cout << b[i] << " ";
}
