#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int n, m, l[200005], r[200005], R[200005], ans[200005], f[200005][2],
    fr[200005][2];
long long t[200005], T[200005];
long long sum(int l, int r) { return 1LL * (l + r) * (r - l + 1) / 2; }
long long find(int l, int r, long long L, long long R) {
  if (L > R) return -1;
  int x = 0, y = r - l + 1;
  while (x < y) {
    int mid = (x + y >> 1);
    if (sum(r - mid + 1, r) >= L)
      y = mid;
    else
      x = mid + 1;
  }
  if ((sum(r - x + 1, r) < L) || (R < sum(l, l + x - 1))) return -1;
  return max(sum(l, l + x - 1), L);
}
void calc(int l, int r, long long k) {
  int x = 0, y = r - l + 1;
  while (x < y) {
    int mid = (x + y >> 1);
    if (sum(r - mid + 1, r) >= k)
      y = mid;
    else
      x = mid + 1;
  }
  if ((sum(r - x + 1, r) < k) || (k < sum(l, l + x - 1))) assert(0);
  while (x > 1) {
    if (k <= l + sum(r - x + 2, r)) {
      k -= l;
      ans[n - l + 1] = 1;
      l++;
    } else {
      k -= r;
      ans[n - r + 1] = 1;
      r--;
    }
    x--;
  }
  if (x == 1) ans[n - k + 1] = 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &t[i]);
  for (int i = 1; i <= n; i++)
    if (t[i] > 0) v.push_back(i);
  for (int i = 0; i < v.size(); i++)
    if ((!i) || (t[v[i]] > t[v[i - 1]])) {
      if (m) r[m] = v[i - 1];
      l[++m] = v[i];
    }
  if (v.size()) r[m] = v.back();
  l[m + 1] = n + 1;
  f[0][1] = -1;
  for (int i = 1; i <= m; i++)
    for (int j = 0; j < 2; j++) {
      f[i][j] = -1;
      if ((l[i] < r[i]) && (!j)) continue;
      ans[0] = ans[1] = -1;
      for (int jj = 0; jj < 2; jj++) {
        if (f[i - 1][jj] < 0) continue;
        long long delta = (t[l[i]] - j) - (t[l[i - 1]] - jj);
        if ((t[l[i]] > t[r[i]]) || (l[i] == r[i]) && (!j)) {
          if (find(n - l[i] + 2, n - f[i - 1][jj], delta - (n - r[i] + 1),
                   delta - (n - r[i] + 1)) >= 0)
            ans[jj] = r[i];
        } else {
          if (i == m) {
            ans[jj] = -1;
            for (int k = l[i]; k <= n + 1; k++)
              if ((!t[k]) &&
                  (find(n - l[i] + 2, n - f[i - 1][jj], delta - (n - k + 1),
                        delta - (n - k + 1)) >= 0)) {
                ans[jj] = k;
                break;
              }
            continue;
          }
          long long s = find(n - l[i] + 2, n - f[i - 1][jj], delta - (n - r[i]),
                             delta - (n - l[i + 1] + 2));
          if (s >= 0) ans[jj] = s - (delta - (n + 1));
        }
      }
      if ((ans[0] < 0) && (ans[1] < 0)) continue;
      if ((ans[0] >= 0) && ((ans[1] < 0) || (ans[0] < ans[1])))
        fr[i][j] = 0;
      else
        fr[i][j] = 1;
      f[i][j] = ans[fr[i][j]];
    }
  int lst = -1;
  if (f[m][0] >= 0) lst = 0;
  if (f[m][1] >= 0) lst = 1;
  memset(ans, 0, sizeof(ans));
  for (int i = m; i; i--) {
    R[i] = f[i][lst];
    T[i] = t[l[i]] - lst;
    lst = fr[i][lst];
    if (R[i] <= n) ans[R[i]] = 1;
  }
  for (int i = 1; i <= m; i++)
    calc(n - l[i] + 2, n - R[i - 1], T[i] - T[i - 1] - (n - R[i] + 1));
  for (int i = 1; i <= n; i++) printf("%d", ans[i]);
}
