#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
int MI = -1e6 - 10;
int MA = 1e6 + 10;
int seg_tree[2][(long long)8e6];
int get_mid(int f, int t) { return f + (t - f) / 2; }
int left_child(int id) { return id * 2 + 1; }
void insert(int ID, int n, int v, int f, int t) {
  if (v < f || v >= t) return;
  ++seg_tree[ID][n];
  if (f + 1 < t) {
    int m = get_mid(f, t);
    int c = left_child(n);
    insert(ID, c, v, f, m);
    insert(ID, c + 1, v, m, t);
  }
}
int query(int ID, int n, int f, int t, int from, int to) {
  f = max(f, from);
  t = min(t, to);
  if (f >= t) return 0;
  if (f == from && t == to) return seg_tree[ID][n];
  int m = get_mid(from, to);
  int c = left_child(n);
  return query(ID, c, f, t, from, m) + query(ID, c + 1, f, t, m, to);
}
int get_low_point(int ID, int n, int from, int to, int smaller_elements) {
  assert(smaller_elements <= -from);
  assert(smaller_elements + seg_tree[ID][n] > -to);
  if (from == to - 1) {
    return from;
  } else {
    int m = get_mid(from, to);
    int c = left_child(n);
    if (smaller_elements + seg_tree[ID][c] <= -m)
      return get_low_point(ID, c + 1, m, to,
                           smaller_elements + seg_tree[ID][c]);
    else
      return get_low_point(ID, c, from, m, smaller_elements);
  }
}
int largest_free(int ID, int n, int f, int t, int from, int to) {
  if (seg_tree[ID][n] == (to - from)) return MI;
  f = max(f, from);
  t = min(t, to);
  if (f >= t) return MI;
  if (from - to < 10) {
  }
  if (from + 1 == to) {
    assert(seg_tree[ID][n] == 0);
    return from;
  }
  int m = get_mid(from, to);
  int c = left_child(n);
  int res = largest_free(ID, c + 1, f, t, m, to);
  if (res == MI) res = largest_free(ID, c, f, t, from, m);
  return res;
}
int smallest_free(int ID, int n, int f, int t, int from, int to) {
  if (seg_tree[ID][n] == (to - from)) return MA;
  f = max(f, from);
  t = min(t, to);
  if (f >= t) return MA;
  if (from - to < 10) {
  }
  if (from + 1 == to) {
    assert(seg_tree[ID][n] == 0);
    return from;
  }
  int m = get_mid(from, to);
  int c = left_child(n);
  int res = smallest_free(ID, c, f, t, from, m);
  if (res == MA) res = smallest_free(ID, c + 1, f, t, m, to);
  return res;
}
int main() {
  memset(seg_tree, 0, sizeof(seg_tree));
  int N;
  cin >> N;
  for (int ii = (0); ii < (N); ii++) {
    int a;
    cin >> a;
    insert(0, 0, a, MI, MA);
    int v = largest_free(1, 0, MI, a + 1, MI, MA);
    insert(1, 0, v, MI, MA);
    int lowpoint = get_low_point(0, 0, MI, MA, 0);
    cout << lowpoint + query(1, 0, lowpoint + 1, MA, MI, MA) << endl;
  }
  return 0;
}
