You are given n vertices and m groups containing vertices that are connected to each other.
find number of vertices related to each vertices .
INPUT
First line will have
N -Number of vertices.
Second line will have
M - Number of sub-groups
Next
2M lines will describe the M sub-groups in following way:
First line
K (the number of vertices in this sub-group)
Second line will contain K space seperated integers denoting vertex number (1−N) which belongs to this subgroup.
OUTPUT
Print N integers where i th integer will be the number of vertex that is connected to it.
CONSTRAIN
N<10^6
0<=M<=N
1<=K<=N
Sample testcase
7
4
3
2 5 4
2
1 2
1
1
2
6 7
Output:
4 4 1 4 4 2 2