def extract_reachable_exit(cavelist):
    random.shuffle(cavelist)
    candidate = None
    for cave in cavelist:
        if (isinstance(cave, tuple) and (len(cave) > 1)):
            if ((cave[0] in ['Turtle Rock Exit (Front)', 'Spectacle Rock Cave Exit (Peak)']) and (len(cave) == 2)):
                continue
            candidate = cave
            break
    if (candidate is None):
        raise RuntimeError('No suitable cave.')
    cavelist.remove(candidate)
    return candidate
def extract_reachable_exit(cavelist):
    random.shuffle(cavelist)
    candidate = None
    for cave in cavelist:
        if (isinstance(cave, tuple) and (len(cave) > 1)):
            if ((cave[0] in ['Turtle Rock Exit (Front)', 'Spectacle Rock Cave Exit (Peak)']) and (len(cave) == 2)):
                continue
            candidate = cave
            break
    if (candidate is None):
        raise RuntimeError('No suitable cave.')
    cavelist.remove(candidate)
    return candidate