from typing import Any


def merge_dict(*dicts: dict[str, Any]) -> dict[str, list[str]]:
    """
    Merge dicts and return a dictionary mapping key to list of values.
    Order of the values corresponds to the order of the original dicts.
    """
    ret: dict[str, list[str]] = {}
    for dict_ in dicts:
        for key, val in dict_.items():
            ret.setdefault(key, []).append(val)
    return ret