def METHOD_NAME(folders: List[str]) -> str:
    versioned_folders = [
        (folder, version.parse(folder[1:]))
        for folder in folders
        if re.match(r"^v[0-9]+\.[0-9]+\.[0-9]+$", folder)
    ]
    versioned_folders.sort(key=lambda ver: ver[1])
    # get the latest version
    if versioned_folders:
        return versioned_folders[-1][0]
    # fall back on main if available as default
    if "main" in folders:
        return "main"
    # fall back on any other folder sorted
    folders.sort()
    return folders[-1]