#include <bits/stdc++.h>
using namespace std;
inline void judge() {
  freopen("message.in", "r", stdin);
  freopen("message.out", "w", stdout);
}
int a[500005];
int h[1000005];
void add(int x) {
  for (; x <= 1000001; x += (x & -x)) h[x]++;
}
int sum(int x) {
  int res = 0;
  for (; x; x -= (x & -x)) res += h[x];
  return res;
}
int tag[4000020], v[4000020];
void init(int u, int l, int r) {
  v[u] = l - 500001;
  if (l == r) return;
  int mid = l + (r - l >> 1);
  init(u << 1, l, mid);
  init((u << 1) | 1, mid + 1, r);
}
void ins(int u, int l, int r, int R) {
  if (!R) return;
  if (r <= R) {
    tag[u]++;
    return;
  }
  int mid = l + (r - l >> 1);
  if (mid >= R)
    ins(u << 1, l, mid, R);
  else
    ins(u << 1, l, mid, R), ins((u << 1) | 1, mid + 1, r, R);
  v[u] = min(tag[u << 1] + v[u << 1], tag[(u << 1) | 1] + v[(u << 1) | 1]);
}
int query(int u, int l, int r, int L) {
  if (l >= L) {
    return v[u] + tag[u];
  }
  tag[u << 1] += tag[u];
  tag[(u << 1) | 1] += tag[u];
  v[u] += tag[u];
  tag[u] = 0;
  int mid = l + (r - l >> 1);
  if (mid < L)
    return query((u << 1) | 1, mid + 1, r, L);
  else
    return min(query(u << 1, l, mid, L), query((u << 1) | 1, mid + 1, r, L));
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i] += 500001;
  init(1, 1, 500000 + 500001);
  printf("%d\n", (a[1] > 500001 ? 1 : (a[1] < 500001 ? -1 : 0)));
  int lab = 0;
  add(a[1]);
  while (lab > -500000 && -sum(lab - 1 + 500001 - 1) < lab - 1) lab--;
  ins(1, 1, 500000 + 500001, a[1] - 1);
  for (int i = 2; i <= n; i++) {
    add(a[i]);
    while (lab > -500000 && -sum(lab - 1 + 500001 - 1) <= lab - 1) lab--;
    int t = -sum(lab + 500001 - 1);
    ins(1, 1, 500000 + 500001, a[i] - 1);
    printf("%d\n", query(1, 1, 500000 + 500001, t + 500001));
  }
  return 0;
}
