#include <bits/stdc++.h>
using namespace std;
namespace Base {
const int inf = 0x3f3f3f3f, INF = 0x7fffffff;
const long long infll = 0x3f3f3f3f3f3f3f3fll, INFll = 0x7fffffffffffffffll;
template <typename T>
void read(T &x) {
  x = 0;
  int fh = 1;
  double num = 1.0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  if (ch == '.') {
    ch = getchar();
    while (isdigit(ch)) {
      num /= 10;
      x = x + num * (ch - '0');
      ch = getchar();
    }
  }
  x = x * fh;
}
template <typename T>
void chmax(T &x, T y) {
  x = x < y ? y : x;
}
template <typename T>
void chmin(T &x, T y) {
  x = x > y ? y : x;
}
}  // namespace Base
using namespace Base;
const int N = 200010;
int n, nl[N], nr[N], cnt, dp[N][2], frm[N][2], mp[N];
long long ned[N][2], t[N];
bool check(int l, int r, long long x) {
  if (x == 0) return true;
  if (x < 0) return false;
  int pl = 1, pr = (r - l) + 1, k = 0;
  while (pl <= pr) {
    int mid = (pl + pr) / 2;
    if (1ll * (l + l + mid - 1) * mid / 2 <= x)
      k = mid, pl = mid + 1;
    else
      pr = mid - 1;
  }
  if (1ll * (r + r - k + 1) * k / 2 >= x)
    return true;
  else
    return false;
}
void reco(int l, int r, long long x) {
  for (int i = l; i <= r; i++) {
    if (check(i + 1, r, x - i)) {
      mp[i] = true;
      x = x - i;
    }
  }
}
int main() {
  read(n);
  for (int i = 1; i <= n; i++) read(t[i]);
  for (int i = 1; i <= n / 2; i++) swap(t[i], t[n - i + 1]);
  for (int i = 1, j; i <= n; i = j) {
    j = i;
    while (t[j] == 0 && j <= n) j++;
    if (j == n + 1) break;
    nl[++cnt] = j;
    int las = j++;
    while ((t[j] - t[nl[cnt]] >= 0 && t[j] - t[nl[cnt]] <= 1 || t[j] == 0) &&
           j <= n) {
      if (t[j] == 0) {
        j++;
        continue;
      }
      las = j;
      if (t[j] - 1 == t[nl[cnt]]) dp[cnt][0] = -1;
      if (t[j] == t[nl[cnt]]) dp[cnt][1] = -1;
      j++;
    }
    nr[cnt] = las;
  }
  dp[cnt + 1][1] = n + 1;
  dp[cnt + 1][0] = -1;
  nr[0] = -1;
  nl[cnt + 1] = n + 1;
  for (int i = cnt; i >= 1; i--) {
    if (dp[i][0] != -1) {
      dp[i][0] = -1;
      long long ti = t[nl[i]] - 1;
      for (int k = nl[i] - 1; k >= nr[i - 1] + 1; k--) {
        if (dp[i + 1][0] != -1) {
          long long dt = ti - t[nl[i + 1]] + 1 - k;
          if (dt >= 0 && check(nr[i] + 1, dp[i + 1][0] - 1, dt)) {
            dp[i][0] = k;
            frm[i][0] = 0;
            ned[i][0] = dt;
            break;
          }
        }
        if (dp[i + 1][1] != -1) {
          long long dt = ti - t[nl[i + 1]] - k;
          if (dt >= 0 && check(nr[i] + 1, dp[i + 1][1] - 1, dt)) {
            dp[i][0] = k;
            frm[i][0] = 1;
            ned[i][0] = dt;
            break;
          }
        }
      }
      if (i == 1) {
        for (int k = nl[i] + 1; k <= nl[i + 1] - 1; k++) {
          if (!(t[k] == t[nl[i]] - 1 || t[k] == 0)) continue;
          if (dp[i + 1][0] != -1 && dp[i + 1][0] > k) {
            long long dt = ti - t[nl[i + 1]] + 1 - k;
            if (dt >= 0 && check(max(nr[i] + 1, k + 1), dp[i + 1][0] - 1, dt)) {
              dp[i][0] = k;
              frm[i][0] = 0;
              ned[i][0] = dt;
              break;
            }
          }
          if (dp[i + 1][1] != -1 && dp[i + 1][1] > k) {
            long long dt = ti - t[nl[i + 1]] - k;
            if (dt >= 0 && check(max(nr[i] + 1, k + 1), dp[i + 1][1] - 1, dt)) {
              dp[i][0] = k;
              frm[i][0] = 1;
              ned[i][0] = dt;
              break;
            }
          }
        }
      }
    }
    if (dp[i][1] != -1) {
      dp[i][1] = -1;
      long long ti = t[nl[i]], k = nl[i];
      if (dp[i + 1][0] != -1) {
        long long dt = ti - t[nl[i + 1]] + 1 - k;
        if (dt >= 0 && check(nr[i] + 1, dp[i + 1][0] - 1, dt)) {
          dp[i][1] = k;
          frm[i][1] = 0;
          ned[i][1] = dt;
          continue;
        }
      }
      if (dp[i + 1][1] != -1) {
        long long dt = ti - t[nl[i + 1]] - k;
        if (dt >= 0 && check(nr[i] + 1, dp[i + 1][1] - 1, dt)) {
          dp[i][1] = k;
          frm[i][1] = 1;
          ned[i][1] = dt;
          continue;
        }
      }
    }
  }
  int j;
  if (dp[1][0] != -1)
    j = 0;
  else
    j = 1;
  for (int i = 1; i <= cnt; i++) {
    mp[dp[i][j]] = 1;
    reco(max(nr[i] + 1, dp[i][j] + 1), dp[i + 1][frm[i][j]] - 1, ned[i][j]);
    j = frm[i][j];
  }
  for (int i = 1; i <= n / 2; i++) swap(mp[i], mp[n - i + 1]);
  for (int i = 1; i <= n; i++) printf("%d", mp[i]);
  puts("");
  return 0;
}
