Print leaves#2316

Print leaves

1 second
128 megabytes
Very easy

Implement a binary search tree for integers. The program receives a sequence of integers and builds a tree from them. Elements are inserted into the tree according to the result of searching for their place. If an element already exists in the tree, it should not be added again. The tree is not balanced.

Print the list of all leaves in the tree (vertices without children) in increasing order.

Input

The program receives a sequence of integers as input. The sequence ends with the number , which indicates the end of input and should not be added to the tree. It is guaranteed that the input sequence contains no more than 10^5 elements, each of which does not exceed 2 \cdot 10^9 in absolute value.

Output

Print the list of all leaves in the tree in increasing order.

Examples

Example 1

Loading
Loading