Sample Input
1 2 3 4 5 -1 6 -1 -1 -1 -1 -1 -1
Sample Output
1 3 6
Explanation
The tree looks like
1
/ \
2 3
/ \ \
4 5 6
When viewed from the right , we would see the nodes 1,3 and 6.
pls help to correct