Now we have a tree which is rooted at node 1, and the tree has N nodes (N <= 100000), then I will tell you a integer w and the value of each node,
There are multiple data sets, process the program to the end of file.
For each data set please output a line with N integers separated by one space, no space after the last integer, the number of most nodes can be selected from each subtree of the corresiponding node such that total value those nodes are no more than w.
5 4
1 2 3 4 5
1 2
1 3
2 4
3 5
2 1 1 1 0