#include <bits/stdc++.h>
using namespace std;
namespace fastIO1 {
inline char read() {
  static const int IN_LEN = 1000000;
  static char buf[IN_LEN], *s, *t;
  return (s == t               ? t = (s = buf) + fread(buf, 1, IN_LEN, stdin),
          (s == t ? -1 : *s++) : *s++);
}
template <class T>
inline void read(T &x) {
  static bool iosig;
  static char c;
  for (iosig = false, c = read(); !isdigit(c); c = read()) {
    if (c == '-') iosig = true;
    if (c == -1) return;
  }
  for (x = 0; isdigit(c); c = read()) x = ((x + (x << 2)) << 1) + (c ^ '0');
  if (iosig) x = -x;
}
inline char readc(char &c) {
  for (c = read(); !isalpha(c) && !isdigit(c); c = read())
    if (c == -1) return 0;
}
const int OUT_LEN = 10000000;
char obuf[OUT_LEN], *ooh = obuf;
inline void print(char c) {
  if (ooh == obuf + OUT_LEN) fwrite(obuf, 1, OUT_LEN, stdout), ooh = obuf;
  *ooh++ = c;
}
template <class T>
inline void print(T x) {
  static int buf[30], cnt;
  if (x == 0)
    print('0');
  else {
    if (x < 0) print('-'), x = -x;
    for (cnt = 0; x; x /= 10) buf[++cnt] = x % 10 + 48;
    while (cnt) print((char)buf[cnt--]);
  }
}
inline void flush() { fwrite(obuf, 1, ooh - obuf, stdout); }
}  // namespace fastIO1
namespace fastIO2 {
template <class T>
inline void read(T &x) {
  static bool iosig;
  static char c;
  for (iosig = false, c = getchar(); !isdigit(c); c = getchar()) {
    if (c == '-') iosig = true;
    if (c == -1) return;
  }
  for (x = 0; isdigit(c); c = getchar()) x = ((x + (x << 2)) << 1) + (c ^ '0');
  if (iosig) x = -x;
}
}  // namespace fastIO2
using namespace fastIO1;
struct seg {
  int tag[(12000010)], mn[(12000010)];
  void build(int L, int R, int x) {
    mn[x] = L;
    if (L == R) return;
    int mid = (L + R) >> 1;
    build(L, mid, x * 2), build(mid + 1, R, x * 2 + 1);
  }
  void pushdown(int x) {
    mn[x * 2] += tag[x], mn[x * 2 + 1] += tag[x];
    tag[x * 2] += tag[x], tag[x * 2 + 1] += tag[x];
    tag[x] = 0;
  }
  void modify(int L, int R, int l, int r, int x) {
    if (l == L && r == R) {
      tag[x]++, mn[x]++;
      return;
    }
    pushdown(x);
    int mid = (L + R) >> 1;
    if (r <= mid)
      modify(L, mid, l, r, x * 2);
    else if (l > mid)
      modify(mid + 1, R, l, r, x * 2 + 1);
    else
      modify(L, mid, l, mid, x * 2), modify(mid + 1, R, mid + 1, r, x * 2 + 1);
    mn[x] = min(mn[x * 2], mn[x * 2 + 1]);
  }
  int query(int L, int R, int l, int r, int x) {
    if (L == l && R == r) return mn[x];
    pushdown(x);
    int mid = (L + R) >> 1;
    if (r <= mid)
      return query(L, mid, l, r, x * 2);
    else if (l > mid)
      return query(mid + 1, R, l, r, x * 2 + 1);
    else
      return min(query(L, mid, l, mid, x * 2),
                 query(mid + 1, R, mid + 1, r, x * 2 + 1));
  }
} T;
int n, m = 500010, t[(12000010)];
void modify(int L, int R, int v, int x) {
  t[x]++;
  if (L == R) return;
  int mid = (L + R) >> 1;
  if (v <= mid)
    modify(L, mid, v, x * 2);
  else
    modify(mid + 1, R, v, x * 2 + 1);
}
int getpos(int L, int R, int sum, int x) {
  if (L == R) return L;
  int mid = (L + R) >> 1;
  if (sum + t[x * 2] == -mid) return mid;
  if (sum + t[x * 2] > -mid)
    return getpos(L, mid, sum, x * 2);
  else
    return getpos(mid + 1, R, sum + t[x * 2], x * 2 + 1);
}
int main() {
  read(n), T.build(-m, m, 1);
  for (int i = 1; i <= n; i++) {
    int x;
    read(x);
    modify(-m, m, x, 1), T.modify(-m, m, -m, x - 1, 1);
    int p = getpos(-m, m, 0, 1);
    printf("%d\n", T.query(-m, m, p, m, 1));
  }
}
