You are given an undirected tree T with N nodes rooted at node 1. Every node is assigned a value denoted by A[i].
You are given Q queries of type:
Input format
Output format
For each query, print the required answer in a new line.
Constraints
1≤N,Q≤5×1051≤A[i]≤1091≤a,b≤N1≤u,v≤N
Subtasks
For 40% score: 1≤N,Q≤103
For Query 1:
For Query 2: