def rmerge(x: dict, y: dict) -> dict:
    """Merge two dicts recursively"""

    new = x.copy()
    for i in y:
        val = y[i]
        if i in new and isinstance(new[i], dict) and isinstance(val, dict):
            val = rmerge(new[i], val)
        new[i] = val

    return new