Input a complete binary tree where each node has an non-negative weight value w, which is called node weight. Path weight is defined as the summation of node weights in a root-to-leaf path. Please calculate the maximum path weight in the tree.
There are lots of complete binary trees in the input. Each tree occupies a line. Tree height is smaller than 10.
For each tree, output the maximum path weight in a line.