<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def inverse_deep_map(f, root):
 """Sibling to |deep_map|. Recursively maps objects in a nested structure of ``list`` and ``dict`` objects. Where |deep_map| starts at the top, |inverse_deep_map| starts at the bottom. First, if `root` is a ``list`` or ``dict``, its contents are |inverse_deep_map|ed. Then at the end, the entire object is passed through `f`. This function was created with decoding from JSON compatible data in mind. .. |inverse_deep_map| replace:: :py:func:`inverse_deep_map`"""

    if isinstance(root, dict):
        r = {k: inverse_deep_map(f, v) for k, v in root.items()}
    elif isinstance(root, list):
        r = [inverse_deep_map(f, v) for v in root]
    else:
        r = root

    return f(r)