n, m = map(int, input().split())

ki = [ None ] * m
pi = [ None ] * m
smi = [ None ] * m

for _ in range(m):
    k, *si = map(int, input().split())

    if k == 0:
        while True:
            pass

    else:
        exit()
