def recursive(fn):
    """
    Make a function to work recursively, regardless dict, list and tuple

    Args:
        fn: processing function

    Returns:
        - a recursive version of given function
    """

    def rfn(x, *args, **kwargs):
        if isinstance(x, dict):
            return {key: rfn(val, *args, **kwargs) for key, val in x.items()}
        elif isinstance(x, list):
            return [rfn(val, *args, **kwargs) for val in x]
        elif isinstance(x, tuple):
            return tuple([rfn(val, *args, **kwargs) for val in x])
        else:
            return fn(x, *args, **kwargs)

    return rfn