Hide

Problem B
Revision Control

Languages en sv

Emil is the treasurer of a nonprofit organization, and he has received $N$ requests to record a specific receipt. However, the issue is that some receipts may have been submitted multiple times but by different individuals.

Your mission is to help Emil figure out what he should do for each request. Emil wants to avoid registering a receipt that he has already recorded.

Emil receives $N$ requests in a specific order, where each request consists of $k_i$, the receipt number for a specific receipt. If Emil encounters a receipt for the first time, he should record it. If Emil has already recorded the receipt before, he should skip that receipt.

Input

The first line consists of an integer, $N$ $(1 \leqslant N \leqslant 3 \cdot 10^5)$, which is the number of requests Emil receives. The second line consists of $N$ integers, where the $i$th number $k_i (1 \leqslant k_i \leqslant 10^9)$ is the ID of the $i$th receipt, for all $1 \leqslant i \leqslant N$.

Output

Print $N$ integers on the same line, where the $i$th number is $1$ if Emil should register the receipt for the $i$th request, and $0$ if Emil should skip the $i$th request.

Points

Your solution will be tested on several test case groups. To get the points for a group, it must pass all the test cases in the group.

Group

Point value

Constraints

$1$

$10$

$N \leqslant 2$

$2$

$30$

$N \leqslant 1000$

$3$

$30$

$k_i \leqslant 10^5$

$4$

$30$

No further constraints.

Sample Input 1 Sample Output 1
5
3 9 4 1 7
1 1 1 1 1
Sample Input 2 Sample Output 2
7
1 3 5 7 2 4 6
1 1 1 1 1 1 1
Sample Input 3 Sample Output 3
3
1 2 1
1 1 0