class AlgRelay:
def __init__(self):
super().__init__()
self.dic: dict[str, int] = {}
# code 1: next mode
# code 2: goal achieved
# code 3: error/failure
# code 4: empty str
# code 5: any other str
def add_next_mode(self, *keys: str) -> None:
for key in keys...