You are given an integer n and a number of non-empty sets of elements from 0 to n−1.
Construct a permutation p of length n, such that for every given set S the following holds: max_s∈Sp_s−min_s∈Sp_s=∣S∣−1.
The solution is guaranteed to exist. If there are multiple solutions output any.
The first line contains two integers n and m (3≤n≤100,1≤m≤100), length of the permutation and the number of sets.
m lines follow. i-th of them contains an integer k_i (2≤k_i<n) followed by k_i integers a_i,j (0≤a_i,j<n,a_i,j\<a_i,j+1), size of the i-th set and its elements themselves.
It is guaranteed that the given sets are pairwise distinct and the answer exists.
Print n integers. i-th of them should be equal to p_i.