Perform a postorder traversal of the binary tree: visit the left subtree first, then the right subtree, then the current node. Output the visited values in that order.
Input format
One line: the binary tree as a level-order array.
The tree is encoded on ONE line as a space-separated level-order (breadth-first) array. The token null marks a missing child; the children of a null are omitted from the array. An empty tree is written as the single token null.
Output format
One line: the node values in postorder, separated by single spaces. If the tree is empty, print an empty line.
Constraints
- The tree has between 0 and 1000 nodes.
- Each node value is an integer with absolute value at most 1000.