<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transpose_nested_dictionary(nested_dict):
 """ Given a nested dictionary from k1 -> k2 > value transpose its outer and inner keys so it maps k2 -> k1 -> value. """

    result = defaultdict(dict)
    for k1, d in nested_dict.items():
        for k2, v in d.items():
            result[k2][k1] = v
    return result