Write a program that forms a binary search tree from a given sequence of natural numbers. Each new integer must be placed at the only leaf that allows to mantain the propierty of the binary search trees. The repeated elements must be ignored.
Input
Input is a non empty sequence of natural numbers.
Output
Your program must print the preorder traversal of the resulting tree.
Input
30 10 50 0 100 15 50 120 30 110
Output
30 10 0 15 50 100 120 110