from typing import OrderedDict


def replicate(d: OrderedDict):
    """
    convert a dict with (element, count) into a list
    with each element replicated count many times
    """
    l = []
    for element, count in d.items():
        l.extend([element]*count)
    return l