# a dictionary mapping exits [north, east, south, west] to the corresponding tile represented by a 2d list
TILES: dict[tuple[int, int, int, int], list[list[set[str]]]] = {
    (0, 0, 0, 0): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (1, 0, 0, 0): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (0, 1, 0, 0): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit east"},
            {"exit east"},
            {"exit east"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (0, 0, 1, 0): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (0, 0, 0, 1): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit west"},
            {"exit west"},
            {"exit west"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (1, 0, 1, 0): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (0, 1, 0, 1): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit west"},
            {"exit west"},
            {"exit west"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit east"},
            {"exit east"},
            {"exit east"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (1, 1, 0, 0): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [{"wall"}, {"wall"}, set(), set(), set(), set(), {"wall"}, {"wall"}, {"wall"}],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit east"},
            {"exit east"},
            {"exit east"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (0, 1, 1, 0): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [{"wall"}, {"wall"}, {"wall"}, set(), set(), set(), set(), {"wall"}, {"wall"}],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit east"},
            {"exit east"},
            {"exit east"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (0, 0, 1, 1): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit west"},
            {"exit west"},
            {"exit west"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [{"wall"}, {"wall"}, {"wall"}, set(), set(), set(), set(), {"wall"}, {"wall"}],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (1, 0, 0, 1): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit west"},
            {"exit west"},
            {"exit west"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [{"wall"}, {"wall"}, set(), set(), set(), set(), {"wall"}, {"wall"}, {"wall"}],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (1, 1, 1, 0): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [{"wall"}, {"wall"}, set(), set(), set(), set(), set(), {"wall"}, {"wall"}],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit east"},
            {"exit east"},
            {"exit east"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (1, 1, 0, 1): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit west"},
            {"exit west"},
            {"exit west"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [{"wall"}, {"wall"}, set(), set(), set(), set(), {"wall"}, {"wall"}, {"wall"}],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [{"wall"}, {"wall"}, set(), set(), set(), set(), {"wall"}, {"wall"}, {"wall"}],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit east"},
            {"exit east"},
            {"exit east"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (1, 0, 1, 1): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit west"},
            {"exit west"},
            {"exit west"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [{"wall"}, {"wall"}, set(), set(), set(), set(), set(), {"wall"}, {"wall"}],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (0, 1, 1, 1): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit west"},
            {"exit west"},
            {"exit west"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [{"wall"}, {"wall"}, {"wall"}, set(), set(), set(), set(), {"wall"}, {"wall"}],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [{"wall"}, {"wall"}, {"wall"}, set(), set(), set(), set(), {"wall"}, {"wall"}],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit east"},
            {"exit east"},
            {"exit east"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
    (1, 1, 1, 1): [
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit west"},
            {"exit west"},
            {"exit west"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [{"wall"}, {"wall"}, set(), set(), set(), set(), set(), {"wall"}, {"wall"}],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [
            {"exit north"},
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            set(),
            {"exit south"},
        ],
        [{"wall"}, {"wall"}, set(), set(), set(), set(), set(), {"wall"}, {"wall"}],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            set(),
            set(),
            set(),
            {"wall"},
            {"wall"},
            {"wall"},
        ],
        [
            {"wall"},
            {"wall"},
            {"wall"},
            {"exit east"},
            {"exit east"},
            {"exit east"},
            {"wall"},
            {"wall"},
            {"wall"},
        ],
    ],
}

# a dictionary mapping the name of obstacle masks to their representation by a 2d list
OBSTACLE_MASKS: dict[str, list[list[set[str]]]] = {
    "blob": [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
        ],
        [
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
        ],
        [
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    "small_blob": [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), {"obstacle"}, set(), set(), set(), set()],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [set(), set(), set(), set(), {"obstacle"}, set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    "bottom_half": [
        [
            set(),
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
    ],
    "top_half": [
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            set(),
        ],
    ],
    "left_half": [
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    "right_half": [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
    ],
    "chess_field": [
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
    ],
    "reverse_chess_field": [
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
        [
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
            set(),
            set(),
            set(),
            {"obstacle"},
            {"obstacle"},
            {"obstacle"},
        ],
    ],
}

# a dictionary mapping exits [north, east, south, west] to the corresponding traffic lanes represented by a 2d list
TRAFFIC_LANES: dict[tuple[int, int, int, int], list[list[set[str]]]] = {
    (0, 0, 0, 1): [
        [
            set(),
            set(),
            set(),
            {"car_lane middle_to_west left"},
            set(),
            {"car_lane all right", "car_lane west_to_middle right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane middle_to_west left"},
            set(),
            {"car_lane west_to_middle right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane middle_to_west left"},
            set(),
            {"car_lane west_to_middle right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane middle_to_west left"},
            set(),
            {"car_lane west_to_middle right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane middle_to_west left"},
            set(),
            {"car_lane west_to_middle right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane middle_to_west left", "car_spawner"},
            set(),
            {"car_lane west_to_middle right"},
            set(),
            set(),
            set(),
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    (0, 0, 1, 0): [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            set(),
            set(),
            set(),
            {"car_lane middle_to_south down", "car_spawner"},
            {"car_lane middle_to_south down"},
            {"car_lane middle_to_south down"},
            {"car_lane middle_to_south down"},
            {"car_lane middle_to_south down"},
            {"car_lane middle_to_south down"},
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            set(),
            set(),
            set(),
            {"car_lane south_to_middle up"},
            {"car_lane south_to_middle up"},
            {"car_lane south_to_middle up"},
            {"car_lane south_to_middle up"},
            {"car_lane south_to_middle up"},
            {"car_lane all up", "car_lane south_to_middle up"},
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    (0, 1, 0, 0): [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_middle left"},
            set(),
            {"car_lane middle_to_east right", "car_spawner"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_middle left"},
            set(),
            {"car_lane middle_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_middle left"},
            set(),
            {"car_lane middle_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_middle left"},
            set(),
            {"car_lane middle_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_middle left"},
            set(),
            {"car_lane middle_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane all left", "car_lane east_to_middle left"},
            set(),
            {"car_lane middle_to_east right"},
            set(),
            set(),
            set(),
        ],
    ],
    (1, 0, 0, 0): [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            {"car_lane all down", "car_lane north_to_middle down"},
            {"car_lane north_to_middle down"},
            {"car_lane north_to_middle down"},
            {"car_lane north_to_middle down"},
            {"car_lane north_to_middle down"},
            {"car_lane north_to_middle down"},
            set(),
            set(),
            set(),
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            {"car_lane middle_to_north up"},
            {"car_lane middle_to_north up"},
            {"car_lane middle_to_north up"},
            {"car_lane middle_to_north up"},
            {"car_lane middle_to_north up"},
            {"car_lane middle_to_north up", "car_spawner"},
            set(),
            set(),
            set(),
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    (0, 0, 1, 1): [
        [
            set(),
            set(),
            set(),
            {"car_lane south_to_west left"},
            set(),
            {"car_lane all right", "car_lane west_to_south right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane south_to_west left"},
            set(),
            {"car_lane west_to_south right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane south_to_west left"},
            set(),
            {"car_lane west_to_south right"},
            {"car_lane west_to_south down"},
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane south_to_west left"},
            set(),
            set(),
            {"car_lane west_to_south right"},
            {"car_lane west_to_south down"},
            {"car_lane west_to_south down"},
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane south_to_west up"},
            {"car_lane south_to_west left"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"car_lane south_to_west up"},
            {"car_lane south_to_west up"},
            {"car_lane south_to_west up"},
            {"car_lane south_to_west up"},
            {"car_lane all up", "car_lane south_to_west up"},
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    (0, 1, 0, 1): [
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left"},
            set(),
            {"car_lane all right", "car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left"},
            set(),
            {"car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left"},
            set(),
            {"car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left"},
            set(),
            {"car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left"},
            set(),
            {"car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left"},
            set(),
            {"car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left"},
            set(),
            {"car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left"},
            set(),
            {"car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane all left", "car_lane east_to_west left"},
            set(),
            {"car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
    ],
    (1, 0, 0, 1): [
        [
            set(),
            set(),
            set(),
            {"car_lane north_to_west left"},
            set(),
            {"car_lane all right", "car_lane west_to_north right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane north_to_west left"},
            set(),
            {"car_lane west_to_north right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            {"car_lane north_to_west left"},
            {"car_lane north_to_west down"},
            set(),
            {"car_lane west_to_north right"},
            set(),
            set(),
            set(),
        ],
        [
            {"car_lane all down", "car_lane north_to_west down"},
            {"car_lane north_to_west down"},
            {"car_lane north_to_west down"},
            set(),
            set(),
            {"car_lane west_to_north right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"car_lane west_to_north up"},
            {"car_lane west_to_north right"},
            set(),
            set(),
            set(),
        ],
        [
            {"car_lane west_to_north up"},
            {"car_lane west_to_north up"},
            {"car_lane west_to_north up"},
            {"car_lane west_to_north up"},
            {"car_lane west_to_north right"},
            set(),
            set(),
            set(),
            set(),
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    (0, 1, 1, 0): [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            set(),
            set(),
            set(),
            set(),
            {"car_lane east_to_south left"},
            {"car_lane east_to_south down"},
            {"car_lane east_to_south down"},
            {"car_lane east_to_south down"},
            {"car_lane east_to_south down"},
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_south left"},
            {"car_lane east_to_south down"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_south left"},
            set(),
            set(),
            {"car_lane south_to_east up"},
            {"car_lane south_to_east up"},
            {"car_lane all up", "car_lane south_to_east up"},
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_south left"},
            set(),
            {"car_lane south_to_east up"},
            {"car_lane south_to_east right"},
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_south left"},
            set(),
            {"car_lane south_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane all left", "car_lane east_to_south left"},
            set(),
            {"car_lane south_to_east right"},
            set(),
            set(),
            set(),
        ],
    ],
    (1, 0, 1, 0): [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            {"car_lane all down", "car_lane north_to_south down"},
            {"car_lane north_to_south down"},
            {"car_lane north_to_south down"},
            {"car_lane north_to_south down"},
            {"car_lane north_to_south down"},
            {"car_lane north_to_south down"},
            {"car_lane north_to_south down"},
            {"car_lane north_to_south down"},
            {"car_lane north_to_south down"},
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            {"car_lane south_to_north up"},
            {"car_lane south_to_north up"},
            {"car_lane south_to_north up"},
            {"car_lane south_to_north up"},
            {"car_lane south_to_north up"},
            {"car_lane south_to_north up"},
            {"car_lane south_to_north up"},
            {"car_lane south_to_north up"},
            {"car_lane all up", "car_lane south_to_north up"},
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    (1, 1, 0, 0): [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            {"car_lane all down", "car_lane north_to_east down"},
            {"car_lane north_to_east down"},
            {"car_lane north_to_east down"},
            {"car_lane north_to_east down"},
            {"car_lane north_to_east down"},
            set(),
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            set(),
            {"car_lane north_to_east right"},
            {"car_lane north_to_east down"},
            set(),
            set(),
            set(),
        ],
        [
            {"car_lane east_to_north up"},
            {"car_lane east_to_north up"},
            {"car_lane east_to_north left"},
            set(),
            set(),
            {"car_lane north_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            {"car_lane east_to_north up"},
            {"car_lane east_to_north left"},
            set(),
            {"car_lane north_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_north left"},
            set(),
            {"car_lane north_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane all left", "car_lane east_to_north left"},
            set(),
            {"car_lane north_to_east right"},
            set(),
            set(),
            set(),
        ],
    ],
    (0, 1, 1, 1): [
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left", "car_lane south_to_west left"},
            set(),
            {
                "car_lane all right",
                "car_lane west_to_east right",
                "car_lane west_to_south right",
            },
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left", "car_lane south_to_west left"},
            set(),
            {"car_lane west_to_east right", "car_lane west_to_south right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left", "car_lane south_to_west left"},
            set(),
            {"car_lane west_to_east right", "car_lane west_to_south right"},
            {"car_lane west_to_south down"},
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left", "car_lane south_to_west left"},
            {"car_lane east_to_south left"},
            {"car_lane east_to_south down", "car_lane west_to_east right"},
            {"car_lane east_to_south down", "car_lane west_to_south right"},
            {"car_lane east_to_south down", "car_lane west_to_south down"},
            {"car_lane east_to_south down", "car_lane west_to_south down"},
        ],
        [
            set(),
            set(),
            set(),
            {
                "car_lane east_to_south left",
                "car_lane east_to_west left",
                "car_lane south_to_west up",
            },
            {"car_lane east_to_south down", "car_lane south_to_west left"},
            {"car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_south left", "car_lane east_to_west left"},
            {"car_lane south_to_west up"},
            {"car_lane south_to_west up", "car_lane west_to_east right"},
            {"car_lane south_to_east up", "car_lane south_to_west up"},
            {"car_lane south_to_east up", "car_lane south_to_west up"},
            {
                "car_lane all up",
                "car_lane south_to_east up",
                "car_lane south_to_west up",
            },
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_south left", "car_lane east_to_west left"},
            set(),
            {"car_lane south_to_east up", "car_lane west_to_east right"},
            {"car_lane south_to_east right"},
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_south left", "car_lane east_to_west left"},
            set(),
            {"car_lane south_to_east right", "car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {
                "car_lane all left",
                "car_lane east_to_south left",
                "car_lane east_to_west left",
            },
            set(),
            {"car_lane south_to_east right", "car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
    ],
    (1, 0, 1, 1): [
        [
            set(),
            set(),
            set(),
            {"car_lane north_to_west left", "car_lane south_to_west left"},
            set(),
            {
                "car_lane all right",
                "car_lane west_to_north right",
                "car_lane west_to_south right",
            },
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane north_to_west left", "car_lane south_to_west left"},
            set(),
            {"car_lane west_to_north right", "car_lane west_to_south right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            {"car_lane north_to_west left"},
            {"car_lane north_to_west down", "car_lane south_to_west left"},
            set(),
            {"car_lane west_to_north right", "car_lane west_to_south right"},
            {"car_lane west_to_south down"},
            set(),
            set(),
        ],
        [
            {
                "car_lane all down",
                "car_lane north_to_south down",
                "car_lane north_to_west down",
            },
            {"car_lane north_to_south down", "car_lane north_to_west down"},
            {"car_lane north_to_south down", "car_lane north_to_west down"},
            {"car_lane north_to_south down", "car_lane south_to_west left"},
            {"car_lane north_to_south down"},
            {"car_lane north_to_south down", "car_lane west_to_north right"},
            {"car_lane north_to_south down", "car_lane west_to_south right"},
            {"car_lane north_to_south down", "car_lane west_to_south down"},
            {"car_lane north_to_south down", "car_lane west_to_south down"},
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane south_to_west up"},
            {"car_lane south_to_west left", "car_lane west_to_north up"},
            {"car_lane west_to_north right"},
            set(),
            set(),
            set(),
        ],
        [
            {"car_lane south_to_north up", "car_lane west_to_north up"},
            {"car_lane south_to_north up", "car_lane west_to_north up"},
            {"car_lane south_to_north up", "car_lane west_to_north up"},
            {"car_lane south_to_north up", "car_lane west_to_north up"},
            {
                "car_lane south_to_north up",
                "car_lane south_to_west up",
                "car_lane west_to_north right",
            },
            {"car_lane south_to_north up", "car_lane south_to_west up"},
            {"car_lane south_to_north up", "car_lane south_to_west up"},
            {"car_lane south_to_north up", "car_lane south_to_west up"},
            {
                "car_lane all up",
                "car_lane south_to_north up",
                "car_lane south_to_west up",
            },
        ],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
    ],
    (1, 1, 0, 1): [
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left", "car_lane north_to_west left"},
            set(),
            {
                "car_lane all right",
                "car_lane west_to_east right",
                "car_lane west_to_north right",
            },
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left", "car_lane north_to_west left"},
            set(),
            {"car_lane west_to_east right", "car_lane west_to_north right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            {"car_lane north_to_west left"},
            {"car_lane east_to_west left", "car_lane north_to_west down"},
            set(),
            {"car_lane west_to_east right", "car_lane west_to_north right"},
            set(),
            set(),
            set(),
        ],
        [
            {
                "car_lane all down",
                "car_lane north_to_east down",
                "car_lane north_to_west down",
            },
            {"car_lane north_to_east down", "car_lane north_to_west down"},
            {"car_lane north_to_east down", "car_lane north_to_west down"},
            {"car_lane east_to_west left", "car_lane north_to_east down"},
            {"car_lane north_to_east down"},
            {"car_lane west_to_east right", "car_lane west_to_north right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_west left"},
            {"car_lane north_to_east right", "car_lane west_to_north up"},
            {
                "car_lane north_to_east down",
                "car_lane west_to_east right",
                "car_lane west_to_north right",
            },
            set(),
            set(),
            set(),
        ],
        [
            {"car_lane east_to_north up", "car_lane west_to_north up"},
            {"car_lane east_to_north up", "car_lane west_to_north up"},
            {"car_lane east_to_north left", "car_lane west_to_north up"},
            {"car_lane east_to_west left", "car_lane west_to_north up"},
            {"car_lane west_to_north right"},
            {"car_lane north_to_east right", "car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            {"car_lane east_to_north up"},
            {"car_lane east_to_north left", "car_lane east_to_west left"},
            set(),
            {"car_lane north_to_east right", "car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_north left", "car_lane east_to_west left"},
            set(),
            {"car_lane north_to_east right", "car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {
                "car_lane all left",
                "car_lane east_to_north left",
                "car_lane east_to_west left",
            },
            set(),
            {"car_lane north_to_east right", "car_lane west_to_east right"},
            set(),
            set(),
            set(),
        ],
    ],
    (1, 1, 1, 0): [
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [set(), set(), set(), set(), set(), set(), set(), set(), set()],
        [
            {
                "car_lane all down",
                "car_lane north_to_east down",
                "car_lane north_to_south down",
            },
            {"car_lane north_to_east down", "car_lane north_to_south down"},
            {"car_lane north_to_east down", "car_lane north_to_south down"},
            {"car_lane north_to_east down", "car_lane north_to_south down"},
            {
                "car_lane east_to_south left",
                "car_lane north_to_east down",
                "car_lane north_to_south down",
            },
            {"car_lane east_to_south down", "car_lane north_to_south down"},
            {"car_lane east_to_south down", "car_lane north_to_south down"},
            {"car_lane east_to_south down", "car_lane north_to_south down"},
            {"car_lane east_to_south down", "car_lane north_to_south down"},
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_south left"},
            {"car_lane east_to_south down", "car_lane north_to_east right"},
            {"car_lane north_to_east down"},
            set(),
            set(),
            set(),
        ],
        [
            {"car_lane east_to_north up", "car_lane south_to_north up"},
            {"car_lane east_to_north up", "car_lane south_to_north up"},
            {"car_lane east_to_north left", "car_lane south_to_north up"},
            {"car_lane east_to_south left", "car_lane south_to_north up"},
            {"car_lane south_to_north up"},
            {"car_lane north_to_east right", "car_lane south_to_north up"},
            {"car_lane south_to_east up", "car_lane south_to_north up"},
            {"car_lane south_to_east up", "car_lane south_to_north up"},
            {
                "car_lane all up",
                "car_lane south_to_east up",
                "car_lane south_to_north up",
            },
        ],
        [
            set(),
            set(),
            {"car_lane east_to_north up"},
            {"car_lane east_to_north left", "car_lane east_to_south left"},
            set(),
            {"car_lane north_to_east right", "car_lane south_to_east up"},
            {"car_lane south_to_east right"},
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {"car_lane east_to_north left", "car_lane east_to_south left"},
            set(),
            {"car_lane north_to_east right", "car_lane south_to_east right"},
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {
                "car_lane all left",
                "car_lane east_to_north left",
                "car_lane east_to_south left",
            },
            set(),
            {"car_lane north_to_east right", "car_lane south_to_east right"},
            set(),
            set(),
            set(),
        ],
    ],
    (1, 1, 1, 1): [
        [
            set(),
            set(),
            set(),
            {
                "car_lane east_to_west left",
                "car_lane north_to_west left",
                "car_lane south_to_west left",
            },
            set(),
            {
                "car_lane all right",
                "car_lane west_to_east right",
                "car_lane west_to_north right",
                "car_lane west_to_south right",
            },
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {
                "car_lane east_to_west left",
                "car_lane north_to_west left",
                "car_lane south_to_west left",
            },
            set(),
            {
                "car_lane west_to_east right",
                "car_lane west_to_north right",
                "car_lane west_to_south right",
            },
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            {"car_lane north_to_west left"},
            {
                "car_lane east_to_west left",
                "car_lane north_to_west down",
                "car_lane south_to_west left",
            },
            set(),
            {
                "car_lane west_to_east right",
                "car_lane west_to_north right",
                "car_lane west_to_south right",
            },
            {"car_lane west_to_south down"},
            set(),
            set(),
        ],
        [
            {
                "car_lane all down",
                "car_lane north_to_east down",
                "car_lane north_to_south down",
                "car_lane north_to_west down",
            },
            {
                "car_lane north_to_east down",
                "car_lane north_to_south down",
                "car_lane north_to_west down",
            },
            {
                "car_lane north_to_east down",
                "car_lane north_to_south down",
                "car_lane north_to_west down",
            },
            {
                "car_lane east_to_west left",
                "car_lane north_to_east down",
                "car_lane north_to_south down",
                "car_lane south_to_west left",
            },
            {
                "car_lane east_to_south left",
                "car_lane north_to_east down",
                "car_lane north_to_south down",
            },
            {
                "car_lane east_to_south down",
                "car_lane north_to_south down",
                "car_lane west_to_east right",
                "car_lane west_to_north right",
            },
            {
                "car_lane east_to_south down",
                "car_lane north_to_south down",
                "car_lane west_to_south right",
            },
            {
                "car_lane east_to_south down",
                "car_lane north_to_south down",
                "car_lane west_to_south down",
            },
            {
                "car_lane east_to_south down",
                "car_lane north_to_south down",
                "car_lane west_to_south down",
            },
        ],
        [
            set(),
            set(),
            set(),
            {
                "car_lane east_to_south left",
                "car_lane east_to_west left",
                "car_lane south_to_west up",
            },
            {
                "car_lane east_to_south down",
                "car_lane north_to_east right",
                "car_lane south_to_west left",
                "car_lane west_to_north up",
            },
            {
                "car_lane north_to_east down",
                "car_lane west_to_east right",
                "car_lane west_to_north right",
            },
            set(),
            set(),
            set(),
        ],
        [
            {
                "car_lane east_to_north up",
                "car_lane south_to_north up",
                "car_lane west_to_north up",
            },
            {
                "car_lane east_to_north up",
                "car_lane south_to_north up",
                "car_lane west_to_north up",
            },
            {
                "car_lane east_to_north left",
                "car_lane south_to_north up",
                "car_lane west_to_north up",
            },
            {
                "car_lane east_to_south left",
                "car_lane east_to_west left",
                "car_lane south_to_north up",
                "car_lane west_to_north up",
            },
            {
                "car_lane south_to_north up",
                "car_lane south_to_west up",
                "car_lane west_to_north right",
            },
            {
                "car_lane north_to_east right",
                "car_lane south_to_north up",
                "car_lane south_to_west up",
                "car_lane west_to_east right",
            },
            {
                "car_lane south_to_east up",
                "car_lane south_to_north up",
                "car_lane south_to_west up",
            },
            {
                "car_lane south_to_east up",
                "car_lane south_to_north up",
                "car_lane south_to_west up",
            },
            {
                "car_lane all up",
                "car_lane south_to_east up",
                "car_lane south_to_north up",
                "car_lane south_to_west up",
            },
        ],
        [
            set(),
            set(),
            {"car_lane east_to_north up"},
            {
                "car_lane east_to_north left",
                "car_lane east_to_south left",
                "car_lane east_to_west left",
            },
            set(),
            {
                "car_lane north_to_east right",
                "car_lane south_to_east up",
                "car_lane west_to_east right",
            },
            {"car_lane south_to_east right"},
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {
                "car_lane east_to_north left",
                "car_lane east_to_south left",
                "car_lane east_to_west left",
            },
            set(),
            {
                "car_lane north_to_east right",
                "car_lane south_to_east right",
                "car_lane west_to_east right",
            },
            set(),
            set(),
            set(),
        ],
        [
            set(),
            set(),
            set(),
            {
                "car_lane all left",
                "car_lane east_to_north left",
                "car_lane east_to_south left",
                "car_lane east_to_west left",
            },
            set(),
            {
                "car_lane north_to_east right",
                "car_lane south_to_east right",
                "car_lane west_to_east right",
            },
            set(),
            set(),
            set(),
        ],
    ],
}
