import typing


def merge(u: typing.Dict, v: typing.Dict, keys: typing.Set[str]) -> typing.Dict:
    """
    Merge the specified keys of the dictionaries one-level deep into the first dictionary. If the values at the key
    cannot be merged, prefer the second value.

    :param u: The first dictionary to merge in.
    :param v: The second dictionary to merge.
    :param keys: The keys to merge.
    """
    for (key, v_value) in v.items():
        if key in keys:
            u_value = u.get(key, None)

            if isinstance(u_value, list) and isinstance(v_value, list):
                u[key] = list(u_value + v_value)
                continue
            elif isinstance(u_value, dict) and isinstance(v_value, dict):
                u_value = u_value.copy()
                u_value.update(v_value)
                u[key] = u_value
                continue
        u[key] = v_value
    return u