For the resulting tree, print a list of all leaves (vertices that have no children) in ascending order.
Input
Enter a sequence of integers ending in zero. Zero itself is not included in the sequence.
Output
Print the answer to the problem.
Examples
# |
Input |
Output |
1 |
7 3 2 1 9 5 4 6 8 0
|
1
4
6
8
|