import itertools


def merge_relation_members(a, b):
    """
    concatenate two lists of members, removing duplicates, retaining order
    """
    combined = []
    added_ids = set()
    for m in itertools.chain(a, b):
        if m[0] not in added_ids:
            combined.append(m)
            added_ids.add(m[0])
    return combined