def merge_dicts(dicts):
    """
    Merge a list of dictionaries into one.
    Later entries override the earlier ones.
    """
    if len(dicts) == 0:
        return {}
    if len(dicts) == 1:
        return dicts[0]

    first, *rest = dicts
    result = dict(first)
    for other in rest:
        result.update(other)
    return result