Tony has just returned from an exchange program in Spain. Since he has not practiced competitive programming for a while, Alexis and Iván want to help him remember some topics about trees, so they give him the following problem.
You are given a tree with $$$n$$$ nodes, rooted at node $$$1$$$. Each node has a color, which can be either white or black, and a weight $$$w_u$$$.
Alexis and Iván give Tony $$$q$$$ operations. Each operation is one of the following types:
For the third type of operation, Tony cannot choose two nodes if one of them is an ancestor of the other. In other words, if Tony chooses a node, he cannot choose any of its ancestors or descendants.
Help Tony process all the operations and answer every query of the third type.
The first line contains two integers $$$n$$$ and $$$q$$$ ($$$1 \le n,q \le 2 \cdot 10^5$$$) — the number of nodes in the tree and the number of operations, respectively.
The second line contains $$$n$$$ integers $$$w_1,w_2,\ldots,w_n$$$ ($$$1 \le w_u \le 10^9$$$) — the initial weight of each node.
The third line contains a string $$$s$$$ of length $$$n$$$, consisting only of characters W and B. If $$$s_u = W$$$, node $$$u$$$ is initially white; otherwise, it is initially black.
Each of the next $$$n-1$$$ lines contains two integers $$$u$$$ and $$$v$$$ ($$$1 \le u,v \le n$$$) — an edge of the tree.
Each of the next $$$q$$$ lines describes one operation in one of the following formats:
For each operation of type 3, print a single integer — the maximum possible total weight of a subset of white nodes such that no selected node is an ancestor of another selected node.
3 65 4 7WBW1 21 332 131 3 102 33
7 4 14
4 78 5 9 6WWBW1 22 33 432 231 1 1232 13
8 9 12 6
6 720 6 7 10 4 9WBWWWB1 21 32 42 53 632 231 3 3032 13
21 20 36 23
| Name |
|---|


