Eezie, a pie maniac, would like to have some pies with her friends on a hot summer day. However, the weather is so hot that she can't go outdoors and has to call for the delivery service.
The city Eezie lives in can be represented by $N$ nodes connected by $N - 1$ edges, and the city center is node $1$. In other words, the city is a rooted tree, root of which is node $1$. There are $N$ pie houses in the city, the $i$-th on node $i$. For some reason, a pie house on node $i$ can only deliver its pie to nodes on the simple path from node $i$ to node $1$.
Eezie is a bit worried that a pie might lose its flavor during the deliver. After some careful calculation, she decided that a pie from the $i$-th pie house can maintain its flavor if the distance it is delivered does not exceed its flavor-loss-distance $d_i$. The distance between two nodes on the tree is the number of edges on the simple path between them.
Now, Eezie wants to order some pies for all her friends who live on different nodes of the tree. Therefore, she wants you to calculate for each node how many pie houses can deliver their pie to the node without flavor loss.