#include <bits/stdc++.h>
const int maxn = 1e7 + 5;
int n, a[maxn], d[maxn];
bool v[maxn];
void prepare() {
  for (int i = 2; i < maxn; i++) {
    if (d[i] != 0) continue;
    for (int j = i; j < maxn; j += i) d[j] = i;
  }
}
int main() {
  prepare();
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int idx = 0, x;
  while (idx < n) {
    bool ok = true;
    x = a[idx];
    while (x != 1) {
      if (v[d[x]]) {
        ok = false;
        break;
      }
      x /= d[x];
    }
    if (ok) {
      x = a[idx];
      while (x != 1) {
        v[d[x]] = true;
        x /= d[x];
      }
      idx++;
      continue;
    }
    while (!ok) {
      ok = true;
      x = ++a[idx];
      while (x != 1) {
        if (v[d[x]]) {
          ok = false;
          break;
        }
        x /= d[x];
      }
    }
    x = a[idx];
    while (x != 1) {
      v[d[x]] = true;
      x /= d[x];
    }
    idx++;
    break;
  }
  int p = 2;
  while (idx < n) {
    for (;; p++) {
      if (d[p] != p || v[p]) continue;
      a[idx++] = p;
      p++;
      break;
    }
  }
  for (int i = 0; i < n; i++) printf("%d ", a[i]);
  return 0;
}
