list = input().split()
n, m = [int(s) for s in list]

k = []
s = []
for i in range(m):
  list = input().split()
  k.append(int(list[0]))
  ss = []
  for j in range(k[i]):
    ss.append(int(list[j+1]))
  s.append(ss)

print(k)
print(ss)