class TreeNode:
def __init__(self, value):
self.value = value
self.children = []
def add_child(self, child_node):
self.children.append(child_node)
# Build a small company org chart
ceo = TreeNode('CEO')
cto = TreeNode('CTO')
cfo = TreeNode('CFO')
ceo.add_child(cto)
ceo.add_child(cfo)
cto.add_child(TreeNode('Engineering Manager'))
print(ceo.value) # CEO
print([child.value for child in ceo.children]) # ['CTO', 'CFO']