bobo has a tree, whose vertices are conveniently labeled by 1,2,…,n. At the very begining, the i-th vertex is assigned with weight w
i.
There are q operations. Each operations are of the following 2 types:
Change the weight of vertex v into x (denoted as "! v x"),
Ask the total weight of vertices whose distance are no more than d away from vertex v (denoted as "? v d").
Note that the distance between vertex u and v is the number of edges on the shortest path between them.
Input
The input consists of several tests. For each tests:
The first line contains n,q (1≤n,q≤10
5). The second line contains n integers w
1,w
2,…,w
n (0≤w
i≤10
4). Each of the following (n - 1) lines contain 2 integers a
i,b
i denoting an edge between vertices a
i and b
i (1≤a
i,b
i≤n). Each of the following q lines contain the operations (1≤v≤n,0≤x≤10
4,0≤d≤n).
Output
For each tests:
For each queries, a single number denotes the total weight.