You are given an undirected tree with nodes and the tree is rooted at node 1. Each node has an integer value associated with it represented by an array of size .
Also, you are given queries of the following type:
Input format
Output format
Print space-separated integers denoting the answer of queries.
Constraints