N,M=map(int,input().split()) table=[(0,0)]*0 J=0 for i in range(M): A=int(input()) D=0 tmp=list(map(int,input().split())) for j in range(A): D+=(1<<(tmp[j]-1)) Y=int(input()) for j in range(len(table)): if (D^table[j][0])