#include <bits/stdc++.h>
using namespace std;
int n, x, mx1[8000000], mn2[8000000], tag1[8000000], tag2[8000000];
void build1(int x, int l, int r) {
  if (l == r) {
    mx1[x] = l;
    return;
  }
  int mid = l + (r - l) / 2;
  build1((x << 1), l, mid);
  build1((x << 1 | 1), mid + 1, r);
  mx1[x] = max(mx1[(x << 1)], mx1[(x << 1 | 1)]);
}
void build2(int x, int l, int r) {
  if (l == r) {
    mn2[x] = l;
    return;
  }
  int mid = l + (r - l) / 2;
  build2((x << 1), l, mid);
  build2((x << 1 | 1), mid + 1, r);
  mn2[x] = min(mn2[(x << 1)], mn2[(x << 1 | 1)]);
}
void psd1(int x) {
  mx1[(x << 1)] += tag1[x];
  mx1[(x << 1 | 1)] += tag1[x];
  tag1[(x << 1)] += tag1[x];
  tag1[(x << 1 | 1)] += tag1[x];
  tag1[x] = 0;
}
void psd2(int x) {
  mn2[(x << 1)] += tag2[x];
  mn2[(x << 1 | 1)] += tag2[x];
  tag2[(x << 1)] += tag2[x];
  tag2[(x << 1 | 1)] += tag2[x];
  tag2[x] = 0;
}
void add(int x, int l, int r, int k) {
  if (l >= k) {
    ++mx1[x];
    ++tag1[x];
    return;
  }
  psd1(x);
  int mid = l + (r - l) / 2;
  if (k <= mid) add((x << 1), l, mid, k);
  add((x << 1 | 1), mid + 1, r, k);
  mx1[x] = max(mx1[(x << 1)], mx1[(x << 1 | 1)]);
}
int fd(int x, int l, int r) {
  if (l == r) return l;
  psd1(x);
  int mid = l + (r - l) / 2;
  if (mx1[(x << 1)] >= 0) return fd((x << 1), l, mid);
  return fd((x << 1 | 1), mid + 1, r);
}
void mdf(int x, int l, int r, int k) {
  if (r <= k) {
    ++mn2[x];
    ++tag2[x];
    return;
  }
  psd2(x);
  int mid = l + (r - l) / 2;
  if (k > mid) mdf((x << 1 | 1), mid + 1, r, k);
  mdf((x << 1), l, mid, k);
  mn2[x] = min(mn2[(x << 1)], mn2[(x << 1 | 1)]);
}
int qry(int x, int l, int r, int k) {
  if (l >= k) return mn2[x];
  psd2(x);
  int mid = l + (r - l) / 2, ret = 0x3f3f3f3f;
  if (mid >= k) ret = min(ret, qry((x << 1), l, mid, k));
  ret = min(ret, qry((x << 1 | 1), mid + 1, r, k));
  return ret;
}
int main() {
  scanf("%d", &n);
  build1(1, -500050, 0);
  build2(1, -500050, 500050);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x);
    if (x < 0) add(1, -500050, 0, x);
    mdf(1, -500050, 500050, x - 1);
    x = fd(1, -500050, 0);
    printf("%d\n", qry(1, -500050, 500050, x));
  }
  return 0;
}
