def reverse_dictionary_dictionary(to_reverse):
    """Exchanges two dictionary layers.

    For instance, dic[keyA][key1] will become dic[key1][keyA].

    Args:
        to_reverse (dict): Dictionary of dictionaries.

    Returns:
        Reversed dictionary.
    """
    first_keys = list(to_reverse.keys())
    second_keys = list(to_reverse[first_keys[0]].keys())
    return {
        s_key: {f_key: to_reverse[f_key][s_key] for f_key in first_keys} for s_key in second_keys
    }