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 c = 200005;
int n, bal, jobb, kezd[c], veg[c], t[c], cnt;
long long ert[c], kov[c][2], ans[c][2];
long long ert2[c];
bool v[c];
bool rossz;
int krit = 109;
vector<int> sz[c][2];
vector<int> alap;
void pb() {
  cnt++;
  kezd[cnt] = bal, veg[cnt] = jobb;
  if (bal == jobb) {
    t[cnt] = 3;
  } else if (ert[bal] == ert[jobb]) {
    t[cnt] = 2;
  } else {
    t[cnt] = 1;
  }
  bal = 0, jobb = 0;
}
long long calc(long long l, long long r) {
  long long db = r - l + 1;
  return db * l + db * (db - 1) / 2;
}
void solve(int kis, int bal, int jobb, long long sum, int id, int tip, int el) {
  if (jobb < kis) {
    return;
  }
  jobb = max(jobb, bal - 1);
  long long ossz = jobb - bal + 1, lo = -1, hi = ossz + 1, mid, mins, maxs;
  while (hi - lo > 1) {
    mid = (hi + lo) / 2;
    mins = calc(bal, bal + mid - 1);
    maxs = calc(jobb - mid + 1, jobb);
    if (kis + maxs < sum) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  if (hi == ossz + 1) {
    return;
  }
  int kisdb = hi, nagydb = 0, spec = 0, add = ossz - hi;
  long long rem = sum - kis - calc(bal, bal + hi - 1);
  while (kisdb && rem > 0) {
    if (rem > add) {
      rem -= add;
      kisdb--, nagydb++;
    } else {
      spec = bal + kisdb - 1 + rem;
      rem = 0;
      kisdb--;
    }
  }
  long long kozel = kis + rem;
  long long sum2 = 0;
  if (kozel > ans[id][tip] && (tip == 0 || kozel == kis)) {
    ans[id][tip] = kozel;
    kov[id][tip] = el;
    vector<int> x;
    x.push_back(kozel);
    for (int i = bal; i <= bal + kisdb - 1; i++) {
      x.push_back(i);
    }
    for (int i = jobb - nagydb + 1; i <= jobb; i++) {
      x.push_back(i);
    }
    if (spec) {
      x.push_back(spec);
    }
    sz[id][tip] = x;
    for (long long y : x) {
      sum2 += y;
    }
    if (sum != sum2) {
      cout << "rossz osszeg\n";
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = n; i >= 1; i--) {
    cin >> ert[i];
    if (ert[i]) {
      alap.push_back(i);
    }
  }
  rossz = (ert[n - 1] == 199997);
  for (int x : alap) {
    if (!bal) {
      bal = x, jobb = x;
    } else if (ert[x] <= ert[jobb]) {
      jobb = x;
    } else {
      pb();
      bal = x, jobb = x;
    }
  }
  if (ert[bal] != ert[jobb]) {
    pb();
  }
  for (int i = 0; i <= n; i++) {
    ans[i][0] = -1, ans[i][1] = -1;
  }
  ans[0][1] = n + 1;
  for (int i = 1; i <= cnt; i++) {
    int un = ans[i - 1][0], ue = ans[i - 1][1];
    long long sum = ert[veg[i]] - ert[veg[i - 1]];
    if (t[i] == 2 || t[i] == 3 && kezd[i]) {
      if (un > kezd[i]) solve(veg[i] - 1, kezd[i] + 1, un - 1, sum, i, 0, 0);
      solve(veg[i] - 1, kezd[i] + 1, ue - 1, sum - 1, i, 0, 1);
    }
    if (t[i] == 1 || t[i] == 3) {
      if (un > kezd[i]) solve(veg[i], kezd[i] + 1, un - 1, sum + 1, i, 1, 0);
      solve(veg[i], kezd[i] + 1, ue - 1, sum, i, 1, 1);
    }
  }
  if (bal) {
    int un = ans[cnt][0], ue = ans[cnt][1];
    long long sum = ert[bal] - ert[veg[cnt]];
    cnt++;
    for (int i = bal; i >= 0; i--) {
      if (!ert[i]) {
        solve(i, bal + 1, un - 1, sum, cnt, 1, 0);
        solve(i, bal + 1, ue - 1, sum - 1, cnt, 1, 1);
        if (ans[cnt][1] >= 0) {
          break;
        }
      }
    }
  }
  int pos = (ans[cnt][0] >= 0 ? 0 : 1);
  for (int i = cnt; i >= 1; i--) {
    for (int x : sz[i][pos]) {
      v[x] = 1;
    }
    pos = kov[i][pos];
  }
  for (int i = n; i >= 1; i--) {
    cout << v[i];
  }
  return 0;
}
