def group_pairs(phenotype_pairs):
    """group unique keys and combine their values"""
    unique_pairs = {}
    for k1, k2, value in phenotype_pairs:
        sorted_pair = tuple(sorted([k1, k2]))
        if sorted_pair not in unique_pairs:
            unique_pairs[sorted_pair] = [value]
        elif value not in unique_pairs[sorted_pair]:
            unique_pairs[sorted_pair].append(value)
    return unique_pairs
