PROGRAMMING:Leaf node summation
For a given binary tree with 'n' nodes ('n > = 0 '), find the sum of leaf node elements.
###Input format:
The first line is a non negative integer 'n', indicating that there are 'n' nodes
The second line is an integer 'k', which is the element value of the root of the tree
Next, there are 'n-1' rows, each of which is a new node in the form of three integers' R D E ',
`R 'represents the element value of the parent node of the node (to ensure the existence of the parent node)` D 'is the direction, ` 0' is the left son of the parent node, ` 1 'is the right son` E 'is the element value of the node.
###Output format:
The sum of leaf node elements in the tree.
###Input example:

For the binary tree in the picture:
```in
three
twenty
20 0 10
20 1 25
```
###Output example:
```out
thirty-five
```
answer:If there is no answer, please comment
###Input format:
The first line is a non negative integer 'n', indicating that there are 'n' nodes
The second line is an integer 'k', which is the element value of the root of the tree
Next, there are 'n-1' rows, each of which is a new node in the form of three integers' R D E ',
`R 'represents the element value of the parent node of the node (to ensure the existence of the parent node)` D 'is the direction, ` 0' is the left son of the parent node, ` 1 'is the right son` E 'is the element value of the node.
###Output format:
The sum of leaf node elements in the tree.
###Input example:

For the binary tree in the picture:
```in
three
twenty
20 0 10
20 1 25
```
###Output example:
```out
thirty-five
```
answer:If there is no answer, please comment