Elephants

아직 제출이 없습니다시간 제한3초메모리 제한256 MB

문제

There are nn elephants living in the grassland, numbered from 11 to nn. Each elephant is either black or white. Unfortunately, you forgot all their individual colors.

You have observed these elephants for mm days. On the ii-th day, there was a group of k_ik\_i elephants x_i1,x_i2,,x_ik_ix\_{i 1}, x\_{i 2}, \ldots, x\_{i k\_i} hanging out. The thing you remember is that the absolute difference between the numbers of black and white elephants in each such group was at most 11.

You have also noticed that the elephants have a pattern of social activities. For any three elephants a,b,ca, b, c, if aa hangs out with bb on day ii and aa hangs out with cc on day jj, then aa hangs out with cc on day ii or aa hangs out with bb on day jj, or both.

Can you find a possible coloring for all elephants?

입력

The first line of input contains two integers nn and mm, the number of elephants and the number of days (1n1061 \leq n \leq 10^6, 0m1060 \leq m \leq 10^6).

Each of the following mm lines contains an integer k_ik\_i followed by k_ik\_i distinct integers x_i1,x_i2,,x_ik_ix\_{i 1}, x\_{i 2}, \ldots, x\_{i k\_i} (1k_in1 \leq k\_i \leq n, k_i106\sum k\_i \leq 10^6, 1x_ijn1 \leq x\_{i j} \leq n).

출력

Print a single line containing nn binary digits separated by spaces. The ii-th digit denotes the color of the ii-th elephant: 00 for white or 11 for black.

If there are several possible solutions, print any one of them.

If there are no solutions, print a single integer 1-1 instead.