You are given n vertices and m groups containing vertices that are connected to each other.
find number of vertices related to each vertices .
First line will have
N -Number of vertices.
Second line will have
M - Number of sub-groups
2M lines will describe the M sub-groups in following way:
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.
Print N integers where i th integer will be the number of vertex that is connected to it.
2 5 4
4 4 1 4 4 2 2