# coding: utf-8


from collections import defaultdict


def make_tree_from_descendats(descendats):
    tree = defaultdict(list)
    for node in descendats:
        tree[node.parent].append(node)
    return tree
