def METHOD_NAME(lines: list[str], lnum: int) -> str:
    bits = lines[lnum].split(' ')
    if (
        len(bits) != 4
        or bits[0] != 'enum'
        or bits[1] != 'class'
        or bits[3] != '{'
    ):
        raise RuntimeError(f'Unexpected format for enum on line {lnum + 1}.')
    enum_name = bits[2]
    return enum_name