#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5, inf = 1e9;
struct data {
  int a, b = inf;
  data() {}
  data(int _a, int _b = inf) : a(_a), b(_b) {}
  friend data operator+(const data &a, const data &b) {
    return data(a.a + b.a, min(a.b + b.a, b.b));
  }
} t[maxn * 4];
int n;
int rk[maxn], a[maxn], id[maxn];
bool cmp(int i, int j) { return a[i] < a[j]; }
void update(int l, int r, int x, int p) {
  if (l == r) {
    t[x] = data(1, a[rk[p]]);
    return;
  }
  int mid = (l + r) >> 1;
  if (p <= mid)
    update(l, mid, x << 1, p);
  else
    update(mid + 1, r, x << 1 | 1, p);
  t[x] = t[x << 1] + t[x << 1 | 1];
}
data query(int l, int r, int x, int a, int b) {
  if (l > b || r < a) return data(0, inf);
  if (l >= a && r <= b) return t[x];
  int mid = (l + r) >> 1;
  return (query(l, mid, x << 1, a, b) + query(mid + 1, r, x << 1 | 1, a, b));
}
int find(int l, int r, int x, int &cnt) {
  if (l == r) return l;
  int mid = (l + r) >> 1;
  if (-(cnt + t[x << 1].a) >= a[rk[mid]]) {
    cnt += t[x << 1].a;
    return find(mid + 1, r, x << 1 | 1, cnt);
  } else
    return find(l, mid, x << 1, cnt);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) rk[i] = i;
  sort(rk + 1, rk + n + 1, cmp);
  for (int i = 1; i <= n; ++i) id[rk[i]] = i;
  a[++n] = inf;
  rk[n] = n;
  for (int i = 1; i < n; ++i) {
    update(1, n, 1, id[i]);
    int cnt = 0, p = find(1, n, 1, cnt);
    data tmp = query(1, n, 1, p, n);
    printf("%d\n", min(tmp.b, tmp.a - cnt));
  }
  return 0;
}
