There are n elephants living in the grassland, numbered from 1 to n. Each elephant is either black or white. Unfortunately, you forgot all their individual colors.
You have observed these elephants for m days. On the i-th day, there was a group of k_i elephants x_i1,x_i2,…,x_ik_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 1.
You have also noticed that the elephants have a pattern of social activities. For any three elephants a,b,c, if a hangs out with b on day i and a hangs out with c on day j, then a hangs out with c on day i or a hangs out with b on day j, or both.
Can you find a possible coloring for all elephants?
The first line of input contains two integers n and m, the number of elephants and the number of days (1≤n≤106, 0≤m≤106).
Each of the following m lines contains an integer k_i followed by k_i distinct integers x_i1,x_i2,…,x_ik_i (1≤k_i≤n, ∑k_i≤106, 1≤x_ij≤n).
Print a single line containing n binary digits separated by spaces. The i-th digit denotes the color of the i-th elephant: 0 for white or 1 for black.
If there are several possible solutions, print any one of them.
If there are no solutions, print a single integer −1 instead.