#include <bits/stdc++.h>
using namespace std;
const int N = 500100, INF = 1e9;
int n, mn[N * 8], mx[N * 4], tag1[N * 4], tag2[N * 8];
void bt1(int o, int l, int r) {
  tag1[o] = 0;
  if (l == r) {
    mx[o] = l;
    return;
  }
  int mid = l + (r - l) / 2;
  bt1(o * 2, l, mid);
  bt1(o * 2 + 1, mid + 1, r);
  mx[o] = max(mx[o * 2], mx[o * 2 + 1]) + tag1[o];
}
void bt2(int o, int l, int r) {
  tag2[o] = 0;
  if (l == r) {
    mn[o] = l;
    return;
  }
  int mid = l + (r - l) / 2;
  bt2(o * 2, l, mid);
  bt2(o * 2 + 1, mid + 1, r);
  mn[o] = min(mn[o * 2], mn[o * 2 + 1]) + tag2[o];
}
int q1, q2, q3;
void mdf1(int o, int l, int r) {
  if (q1 <= l && r <= q2) {
    ++mx[o];
    ++tag1[o];
    return;
  }
  int mid = l + (r - l) / 2;
  if (q1 <= mid) mdf1(o * 2, l, mid);
  if (q2 > mid) mdf1(o * 2 + 1, mid + 1, r);
  mx[o] = max(mx[o * 2], mx[o * 2 + 1]) + tag1[o];
}
void mdf2(int o, int l, int r) {
  if (q1 <= l && r <= q2) {
    ++mn[o];
    ++tag2[o];
    return;
  }
  int mid = l + (r - l) / 2;
  if (q1 <= mid) mdf2(o * 2, l, mid);
  if (q2 > mid) mdf2(o * 2 + 1, mid + 1, r);
  mn[o] = min(mn[o * 2], mn[o * 2 + 1]) + tag2[o];
}
void qry1(int o, int l, int r, int tag = 0) {
  if (l == r) {
    q1 = l;
    return;
  }
  int mid = l + (r - l) / 2;
  tag += tag1[o];
  if (mx[o * 2] + tag >= 0)
    qry1(o * 2, l, mid, tag);
  else
    qry1(o * 2 + 1, mid + 1, r, tag);
}
void qry2(int o, int l, int r, int tag = 0) {
  if (q1 <= l && r <= q2) {
    q3 = min(q3, mn[o] + tag);
    return;
  }
  int mid = l + (r - l) / 2;
  tag += tag2[o];
  if (q1 <= mid) qry2(o * 2, l, mid, tag);
  if (q2 > mid) qry2(o * 2 + 1, mid + 1, r, tag);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  bt1(1, -N, 0);
  bt2(1, -N, N);
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    if (x < 0) {
      q1 = x;
      q2 = 0;
      mdf1(1, -N, 0);
    }
    q1 = -N;
    q2 = x - 1;
    mdf2(1, -N, N);
    qry1(1, -N, 0);
    q2 = N;
    q3 = INF;
    qry2(1, -N, N);
    cout << q3 << '\n';
  }
  return 0;
}
