A binary search tree is a binary tree that satisfies the following properties:
The left subtree of the root contains only nodes with keys less than the root's key.
The right subtree of the root contains only nodes with keys greater than the root's key.
Both the left and right subtrees must also be binary search trees.

Pre-order traversal (Root-Left-Right) visits the root node, then the left subtree, and then the right subtree, outputting node keys in this order. Post-order traversal (Left-Right-Root) visits the left subtree, then the right subtree, and finally the root node, outputting their keys. For example, the results of pre-order and post-order traversals of the binary tree shown above are:
Pre-order: 50 30 24 5 28 45 98 52 60
Post-order: 5 28 24 45 30 60 52 98 50
Given the pre-order traversal of a binary search tree, find its post-order traversal.
The keys of all nodes in the binary search tree are given in the order of pre-order traversal. Each node's key is a positive integer less than 10^6. All keys are given in separate lines (one number per line). The tree has no more than nodes and does not contain duplicate keys.
Print the post-order traversal of the tree. Output one key per line.
Example 1