import re


def get_final_models(path):
    """Get the final clusterN_N.pdb stuctures."""
    cluster_regex = r"cluster(\d)_\d.pdb"
    cluster_dic = {}
    for element in sorted(path.glob("*pdb")):
        match = re.search(cluster_regex, str(element))
        if match:
            cluster_name = int(match.group(1))
            if cluster_name not in cluster_dic:
                cluster_dic[cluster_name] = []
            cluster_dic[cluster_name].append(element)
    return cluster_dic