from typing import Callable


def iter_dct(dct: dict, operation: Callable):
    """Recursively iterate the dictionary and operate on the leaf nodes. Return the processed dictionary."""
    dct2 = dict()
    for key, value in dct.items():
        if isinstance(value, dict):
            dct2[key] = iter_dct(value, operation)
        else:
            dct2[key] = operation(value)
    return dct2