**Problem Description**

We define Si（Si = 0, 1, 2, 3） as the i-th people’s initial sober degree. There are four conditions below:

1. Si = 0: he will fall asleep at the beginning of the meeting immediately.

2. Si = 1: If he sees anyone fall asleep, he will fall asleep immediately.

3. Si = 2: If all people he can see fall asleep, he will fall asleep immediately.

4. Si = 3: He will never fall asleep.

We assume that the meeting will last long enough time, and people who fall asleep will not wake up before the end of the meeting. You should determine for each people, whether he will fall asleep during the meeting or not.

**Input**

There are multiple cases.

For each case, the first line is a integer N (2 <= N <= 1000), indicating the number of the people. The second line contains N integers （Si = 0, 1, 2, 3）, indicating the initial sober degree of the i-th people.

**Output**

For each case, output N integers, indicating each people’s status in order. Print 1 if he will fall asleep during the meeting, otherwise print 0.

**Sample Input**

3 1 0 1 3 2 0 2 3 0 2 1 3 1 0 3

**Sample Output**

1 1 1 1 1 1 1 0 0 1 1 0

**Source**

2015绍兴市计算机技能竞赛