PROGRAMMING:List leaf nodes
For a given binary tree, this problem requires you to output all the leaf nodes from top to bottom and from left to right.
###Input format:
First, the first line gives a positive integer, $$n $$($$Le 10 $$), which is the total number of nodes in the tree. The nodes in the tree are numbered from 0 to $$n-1 $. Next, $$n $$lines, each line gives a number of the left and right children of the corresponding node. If a child doesn't exist, give a '-' in the corresponding position. The numbers are separated by a space.
###Output format:
Output the number of leaf nodes in a row in the specified order. The numbers shall be separated by one space, and there shall be no extra space at the beginning and end of the line.
###Input example:
```in
eight
1 -
- -
0 -
2 7
- -
- -
5 -
4 6
```
###Output example:
```out
4 1 5
```
answer:If there is no answer, please comment
###Input format:
First, the first line gives a positive integer, $$n $$($$Le 10 $$), which is the total number of nodes in the tree. The nodes in the tree are numbered from 0 to $$n-1 $. Next, $$n $$lines, each line gives a number of the left and right children of the corresponding node. If a child doesn't exist, give a '-' in the corresponding position. The numbers are separated by a space.
###Output format:
Output the number of leaf nodes in a row in the specified order. The numbers shall be separated by one space, and there shall be no extra space at the beginning and end of the line.
###Input example:
```in
eight
1 -
- -
0 -
2 7
- -
- -
5 -
4 6
```
###Output example:
```out
4 1 5
```
answer:If there is no answer, please comment