#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 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 << 1) + (x << 3) + c - '0';
  x *= f;
}
int n;
int a[N];
struct misaka {
  int sum, max, min, tag;
} seg[N << 3];
void pushup(int u) {
  seg[u].sum = seg[(u << 1)].sum + seg[(u << 1 | 1)].sum;
  seg[u].min = min(seg[(u << 1)].min, seg[(u << 1 | 1)].min);
  seg[u].max = max(seg[(u << 1)].max, seg[(u << 1 | 1)].max);
}
void pushdown(int u) {
  seg[(u << 1)].min -= seg[u].tag;
  seg[(u << 1 | 1)].min -= seg[u].tag;
  seg[(u << 1)].tag += seg[u].tag;
  seg[(u << 1 | 1)].tag += seg[u].tag;
  seg[u].tag = 0;
}
void build(int u, int l, int r) {
  seg[u].max = -1e9;
  seg[u].min = l;
  if (l == r) return;
  int mid = l + r >> 1;
  build((u << 1), l, mid);
  build((u << 1 | 1), mid + 1, r);
  pushup(u);
}
void update1(int u, int l, int r, int x, int k) {
  if (l == r) {
    seg[u].sum += k;
    seg[u].max = l;
    return;
  }
  if (seg[u].tag) pushdown(u);
  int mid = l + r >> 1;
  if (x <= mid)
    update1((u << 1), l, mid, x, k);
  else
    update1((u << 1 | 1), mid + 1, r, x, k);
  pushup(u);
}
void update2(int u, int l, int r, int ql, int qr, int k) {
  if (l >= ql && r <= qr) {
    seg[u].min -= k;
    seg[u].tag += k;
    return;
  }
  if (seg[u].tag) pushdown(u);
  int mid = l + r >> 1;
  if (ql <= mid) update2((u << 1), l, mid, ql, qr, k);
  if (qr > mid) update2((u << 1 | 1), mid + 1, r, ql, qr, k);
  pushup(u);
}
int query1(int u, int l, int r, int ql, int qr) {
  if (l >= ql && r <= qr) return seg[u].sum;
  int mid = l + r >> 1;
  int res = 0;
  if (ql <= mid) res += query1((u << 1), l, mid, ql, qr);
  if (qr > mid) res += query1((u << 1 | 1), mid + 1, r, ql, qr);
  return res;
}
int query2(int u, int l, int r, int ql, int qr) {
  if (l >= ql && r <= qr) return seg[u].min;
  if (seg[u].tag) pushdown(u);
  int mid = l + r >> 1;
  if (qr <= mid) return query2((u << 1), l, mid, ql, qr);
  if (ql > mid) return query2((u << 1 | 1), mid + 1, r, ql, qr);
  return min(query2((u << 1), l, mid, ql, qr),
             query2((u << 1 | 1), mid + 1, r, ql, qr));
}
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], 1);
    update2(1, -5e5, 5e5, a[i], 5e5, 1);
    int l = -5e5, r = 5e5, val = -1e9;
    while (l <= r) {
      int mid = l + r >> 1;
      if (mid >= -query1(1, -5e5, 5e5, -5e5, mid))
        val = mid, r = mid - 1;
      else
        l = mid + 1;
    }
    printf("%d\n", query1(1, -5e5, 5e5, val, 5e5) +
                       min(val, query2(1, -5e5, 5e5, val, 5e5) +
                                    query1(1, -5e5, 5e5, -5e5, val - 1)));
  }
  return 0;
}
