#include <bits/stdc++.h>
using namespace std;
const int N = 500002;
struct SGT {
  int c, add;
} tr[4000010];
int a[500010], n, M, p, cnt[500010];
inline void build(int p, int l, int r) {
  tr[p].c = l - N;
  if (l >= r) return;
  int mid = (l + r) >> 1;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid + 1, r);
}
inline void modify(int p, int l, int r, int k, int val) {
  if (r == k) {
    tr[p].c += val;
    tr[p].add += val;
    return;
  }
  int mid = (l + r) >> 1;
  modify(p << 1, l, mid, min(mid, k), val);
  if (k > mid) modify(p << 1 | 1, mid + 1, r, k, val);
  tr[p].c = min(tr[p << 1].c, tr[p << 1 | 1].c) + tr[p].add;
}
inline int query(int p, int l, int r) {
  if (l == M) return tr[p].c;
  int mid = (l + r) >> 1;
  if (M > mid) return query(p << 1 | 1, mid + 1, r) + tr[p].add;
  return min(tr[p << 1 | 1].c, query(p << 1, l, mid)) + tr[p].add;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  build(1, 0, N << 1);
  M = N;
  for (int i = 1; i <= n; i++) {
    p = a[i] + N;
    if (p < M) {
      cnt[p]++;
      if (--cnt[M] < 0) M--;
    }
    modify(1, 0, N << 1, p - 1, 1);
    printf("%d\n", query(1, 0, N << 1));
  }
  return 0;
}
