H. La Vaca Saturno Saturnino
time limit per test
4 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

La Vaca Saturno Saturnino, the owner of Saturnino's Restaurant (RS), is tired of seeing students cutting in line at her restaurant. Because of this, she has decided to cancel the academic registration (RA) of all students who cut in line at tonight's dinner.

Through the RS cameras, she has records of the students in the queue at different moments, in order. These records are in increasing order of time.

She asks you to, given these records, print for each student whether they cut in line or not.

It is guaranteed that once a student enters the queue, whether at the end or not, they do not change their position relative to the other students already in the queue. Therefore, it is only possible for a student to cut in line when entering the queue, by joining before the end of the queue. It is also guaranteed that no student enters the queue more than once, and that no student leaves the queue before all those in front of them have left. It is possible that a student never enters the queue.

Input

The first line of input contains two integers $$$N$$$ and $$$M$$$ ($$$1 \leq N, M \leq 10^5$$$) — the number of queue records and the number of students.

Then follow $$$2N$$$ lines, where each pair of lines describes a queue record.

The first line of the $$$i$$$-th pair contains an integer $$$K_i$$$ ($$$1 \leq K_i \leq 10^5$$$), the number of people in the queue in this record.

The second line of the $$$i$$$-th pair contains $$$K_i$$$ integers $$$A_{ij}$$$ ($$$1 \leq A_{ij} \leq M$$$), representing the students in the queue in this record, in order from the first to the last in the queue.

It is guaranteed that the sum of all $$$K_i$$$ does not exceed $$$10^5$$$.

Output

Print a line with $$$M$$$ integers separated by spaces, where the $$$i$$$-th integer is 1 if the $$$i$$$-th student cut in line, and 0 otherwise.

Examples
Input
2 5
3
1 3 5
5
1 2 3 4 5
Output
0 1 0 1 0
Input
3 10
3
1 3 5
4
3 5 7 9
4
7 8 9 10
Output
0 0 0 0 0 0 0 1 0 0
Input
2 8
3
5 4 3
3
8 2 6
Output
0 0 0 0 0 0 0 0