#!/usr/bin/env python3

import sys
import tomllib
import struct
import io

def usage():
    print(f"Usage: {sys.argv[0]} input.txt [subtask_name]", file=sys.stderr)
    exit(1)

def run(f, st):
    for k, v in subtask[st].items():
        globals()[k] = v

    sys.stdin = f
    # input validator does not need to be superstrict with whitespace here
    # as contestant program will never see it directly, only manager reads it
    tcs = int(input())
    m = int(input())
    assert 1 <= m <= 1000000*1000000*1000000
    sumn = 0
    for i in range(tcs):
        n = int(input())
        assert 1 <= n <= MAXN
        indices = [int(x) for x in input().split()]
        assert len(set(indices)) == n 
        for id in indices:
            assert 0 <= id < m
        if CONSECUTIVE:
            assert set(indices) == set(range(n))
        sumn += n
    assert 1 <= sumn <= 100

if __name__ == "__main__":
    if len(sys.argv) < 2:
        usage()

    st = sys.argv[2]

    with open("gen.toml", "rb") as gen_toml:
        gen_toml = tomllib.load(gen_toml)
        global_variables = globals()
        global_variables |= gen_toml
        print(subtask)
        global_variables |= subtask[st]

    f = open(sys.argv[1], "rb")
    run(f, st)
