def build_nested(nested_dict, reverse_path):
    """Build a nested dictionary from a reversed path (lowest level -> highest level)

    :param nested_dict: starting dictionary
    :param reverse_path: path from current level up
    :return: nested dictionary from path
    """
    if len(reverse_path) == 0:
        return nested_dict
    cur_level = reverse_path.pop(0)
    new_dict = {cur_level: nested_dict}
    if len(reverse_path) > 0:
        return build_nested(new_dict, reverse_path)
    else:
        return new_dict