Slime and Orac are holding a turn-based game. In a big room, there are n players sitting on the chairs, looking forward to a column and each of them is given a number: player 1 sits in the front of the column, player 2 sits directly behind him; player 3 sits directly behind player 2, and so on; player n sits directly behind player n-1. Each player wears a hat that is either black or white. As each player faces forward, player i knows the color of player j's hat if and only if i is larger than j.

At the start of each turn, Orac will tell whether there exists a player wearing a black hat in the room.

After Orac speaks, if the player can uniquely identify the color of his hat, he will put his hat on the chair, stand up and leave the room. All players are smart, so if it is possible to understand the color of their hat using the obtained information during this and previous rounds, they will understand it.

In each turn, all players who know the color of their hats will leave at the same time in this turn, which means a player can only leave in the next turn if he gets to know the color of his hat only after someone left the room at this turn.

Note that when the player needs to leave, he will put the hat on the chair before leaving, so the players ahead of him still cannot see his hat. 

The i-th player will know who exactly left the room among players 1,2,…,i-1, and how many players among i+1,i+2,…,n have left the room.

Slime stands outdoor. He watches the players walking out and records the numbers of the players and the time they get out. Unfortunately, Slime is so careless that he has only recorded some of the data, and this given data is in the format "player x leaves in the y-th round".

Slime asked you to tell him the color of each player's hat. If there are multiple solutions, you can find any of them.

Input

The first line contains a integer n\ (1≤ n≤ 200 000).

The second line contains n integers t_1,t_2,...,t_n\ (0≤ t_i≤ 10^{15}). If t_i=0, then there are no data about player i; otherwise it means player i leaves in the t_i-th round.

At least one solution exists for the given input. 

Output

Print one binary string of n characters. The i-th character of the string should be '1' if player i wears a black hat and should be '0', otherwise. If there are multiple solutions, you can print any of them.

Examples

Input


5
0 1 1 0 0


Output


00000

Input


5
0 2 2 0 0


Output


00001

Input


5
0 0 0 0 0


Output


00000

Input


5
4 4 0 4 4


Output


00100

Note

In the first example, for the given solution, all the players wear white hats. In the first turn, Orac tells all the players that there are no players wearing a black hat, so each player knows that he is wearing a white hat, and he will leave in the first turn.

In the second example, for the given solution, the player 5 wears a black hat, other players wear white hats. Orac tells all the players that there exists a player wearing a black hat, and player 5 know that the other players are all wearing white hats, so he can infer that he is wearing a black hat; therefore he leaves in the first turn, other players leave in the second turn. Note that other players can infer that they are wearing white hats immediately after player 5 leaves, but they have to wait for the next turn to leave according to the rule.

In the third example, there is no information about the game, so any output is correct.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300100;
long long orig[MAXN];
int n;
pair<long long, long long> arr[MAXN];
long long larr, seg[MAXN], lseg;
string ans;
map<pair<long long, long long>, pair<long long, long long>> from_dp;
map<pair<long long, long long>,
    pair<pair<long long, long long>, pair<long long, long long>>>
    turn;
void UpdDp(const long long add_sum_to, const long long min_to_idx,
           const long long min_idx, const long long max_idx,
           const unordered_map<long long, long long>& dp,
           unordered_map<long long, long long>* nxt_dp) {
  for (const auto& it : dp) {
    long long add_sum = add_sum_to - it.first;
    for (int i = 0; i < min_to_idx - it.second; i++) {
      long long max_add =
          add_sum - 1ll * (n - min_to_idx + 1 + n - min_to_idx + i) * i / 2;
      long long min_add =
          add_sum - 1ll * (n - it.second - 1 + n - it.second - i) * i / 2;
      long long rmin_idx = max(min_idx, it.second + 1);
      if (max_add >= n - max_idx && min_add <= n - rmin_idx) {
        if (nxt_dp->find(add_sum_to) == nxt_dp->end()) {
          (*nxt_dp)[add_sum_to] = n;
        }
        long long& nxt = (*nxt_dp)[add_sum_to];
        long long nxt_val = max(n - max_add, rmin_idx);
        if (nxt > nxt_val) {
          nxt = nxt_val;
          from_dp[make_pair(add_sum_to, nxt_val)] = it;
          turn[make_pair(add_sum_to, nxt_val)] =
              make_pair(make_pair(it.second + 1, min_to_idx - 1),
                        make_pair(add_sum - n + nxt_val, i));
        }
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  long long last = 0;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", orig + i);
    if (orig[i] != 0) {
      arr[larr++] = make_pair(orig[i], i);
      if (last < arr[larr - 1].first) {
        seg[lseg++] = larr - 1;
      }
      last = arr[larr - 1].first;
    }
  }
  arr[larr] = make_pair(-1, n);
  seg[lseg] = larr;
  ans = string(n, '0');
  unordered_map<long long, long long> dp[2];
  int now = 0, nxt = 1;
  dp[now][0] = -1;
  for (int i = 0; i < lseg; i++) {
    dp[nxt].clear();
    long long max_idx = arr[seg[i + 1]].second - 1;
    long long min_idx = arr[seg[i + 1] - 1].second + 1;
    if (arr[seg[i + 1] - 1].first < arr[seg[i]].first) {
      max_idx = arr[seg[i + 1] - 1].second;
      min_idx = max_idx;
    }
    UpdDp(arr[seg[i]].first - 1, arr[seg[i]].second, min_idx, max_idx, dp[now],
          &dp[nxt]);
    if (seg[i + 1] - seg[i] == 1) {
      UpdDp(arr[seg[i]].first, arr[seg[i]].second, arr[seg[i]].second,
            arr[seg[i]].second, dp[now], &dp[nxt]);
    }
    if (i + 1 == lseg && arr[seg[i]].first == arr[larr - 1].first) {
      for (long long j = seg[i] - 1; j < larr; j++) {
        if (arr[j + 1].second > arr[j].second + 1 || j == -1) {
          UpdDp(arr[seg[i]].first - 1, arr[seg[i]].second,
                (j == -1 ? 0 : arr[j].second + 1), arr[j + 1].second - 1,
                dp[now], &dp[nxt]);
        }
      }
    }
    if (i == lseg - 1 ||
        (i == lseg - 2 &&
         arr[seg[lseg - 1]].first - arr[seg[lseg - 1] - 1].first == 1)) {
      if (dp[nxt].size()) {
        for (pair<long long, long long> rfrom = *dp[nxt].begin();
             rfrom.first > 0; rfrom = from_dp[rfrom]) {
          ans[rfrom.second] = '1';
          const pair<pair<long long, long long>, pair<long long, long long>>&
              rturn = turn[rfrom];
          if (rturn.second.second) {
            long long cnt = rturn.second.second;
            long long sum = rturn.second.first;
            long long st = rturn.first.first, en = rturn.first.second;
            for (int j = st; j <= en && cnt; j++) {
              if (1ll * (n - en + n - en + cnt - 2) * (cnt - 1) / 2 <=
                  sum - n + j) {
                ans[j] = '1';
                sum -= n - j;
                cnt--;
              }
            }
          }
        }
        break;
      }
    }
    swap(now, nxt);
  }
  cout << ans << endl;
  return 0;
}
