#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
template <typename T>
void read(T &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  x = x * f;
}
int n;
int a[N];
struct SegmentTree {
  int sum;
  int min;
  int tag;
} seg[N << 2];
void pushup(int x) {
  seg[x].sum = seg[(x << 1)].sum + seg[(x << 1 | 1)].sum;
  seg[x].min = min(seg[(x << 1)].min, seg[(x << 1 | 1)].min);
}
void renew(int x, int k) {
  seg[x].min += k;
  seg[x].tag += k;
}
void pushdown(int x) {
  renew((x << 1), seg[x].tag);
  renew((x << 1 | 1), seg[x].tag);
  seg[x].tag = 0;
}
void build(int x, int l, int r) {
  if (l == r) {
    seg[x].min = l;
    return;
  }
  int mid = (l + r) >> 1;
  build((x << 1), l, mid);
  build((x << 1 | 1), mid + 1, r);
  pushup(x);
}
void update1(int x, int l, int r, int ql, int qr, int k) {
  if (ql <= l && qr >= r) {
    renew(x, k);
    return;
  }
  if (seg[x].tag) pushdown(x);
  int mid = (l + r) >> 1;
  if (ql <= mid) update1((x << 1), l, mid, ql, qr, k);
  if (qr > mid) update1((x << 1 | 1), mid + 1, r, ql, qr, k);
  pushup(x);
}
void update2(int x, int l, int r, int u, int k) {
  if (l == r) {
    seg[x].sum += k;
    return;
  }
  if (seg[x].tag) pushdown(x);
  int mid = (l + r) >> 1;
  if (u <= mid)
    update2((x << 1), l, mid, u, k);
  else
    update2((x << 1 | 1), mid + 1, r, u, k);
  pushup(x);
}
int query1(int x, int l, int r, int k) {
  if (l == r) return l;
  if (seg[x].tag) pushdown(x);
  int mid = (l + r) >> 1;
  if (seg[(x << 1)].sum + k >= -mid)
    return query1((x << 1), l, mid, k);
  else
    return query1((x << 1 | 1), mid + 1, r, k + seg[(x << 1)].sum);
}
int query2(int x, int l, int r, int ql, int qr) {
  if (ql <= l && qr >= r) return seg[x].min;
  if (seg[x].tag) pushdown(x);
  int mid = (l + r) >> 1;
  if (qr <= mid) return query2((x << 1), l, mid, ql, qr);
  if (ql > mid) return query2((x << 1 | 1), mid + 1, r, ql, qr);
  return min(query2((x << 1), l, mid, ql, qr),
             query2((x << 1 | 1), mid + 1, r, ql, qr));
}
int query3(int x, int l, int r, int ql, int qr) {
  if (ql <= l && qr >= r) return seg[x].sum;
  if (seg[x].tag) pushdown(x);
  int mid = (l + r) >> 1;
  int res = 0;
  if (ql <= mid) res += query3((x << 1), l, mid, ql, qr);
  if (qr > mid) res += query3((x << 1 | 1), mid + 1, r, ql, qr);
  return res;
}
int main() {
  read(n);
  for (int i = 1; i <= n; ++i) read(a[i]);
  build(1, -5e5, 5e5);
  for (int i = 1; i <= n; ++i) {
    update1(1, -5e5, 5e5, a[i], 5e5, -1);
    update2(1, -5e5, 5e5, a[i], 1);
    int pos = query1(1, -5e5, 5e5, 0);
    printf("%d\n", query3(1, -5e5, 5e5, pos, 5e5) +
                       min(pos, query2(1, -5e5, 5e5, pos, 5e5) +
                                    query3(1, -5e5, 5e5, -5e5, pos - 1)));
  }
  return 0;
}
