class Solution(object):
    def postorder(self, root):
        """
        :type root: Node
        :rtype: List[int]
        """
        self.ans=[]
        def helper(root):
            if not root:
                return
            for item in root.children:
                helper(item)
            self.ans.append(root.val)
        if not root:
            return []
        helper(root)
        return self.ans
s=Solution()
print(s.preorder(1))



