Problem Description
You are given a tree with N nodes which are numbered by integers 1..N. Each node is associated with an integer as the weight.
Your task is to deal with M operations of 4 types:
 Delete an edge (x, y) from the tree, and then add a new edge (a, b). We ensure that it still constitutes a tree after adding the new edge.
 Given two nodes a and b in the tree, change the weights of all the nodes on the path connecting node a and b (including node a and b) to a particular value x.
 Given two nodes a and b in the tree, increase the weights of all the nodes on the path connecting node a and b (including node a and b) by a particular value d.
 Given two nodes a and b in the tree, compute the second largest weight on the path connecting node a and b (including node a and b), and the number of times this weight occurs on the path. Note that here we need the strict second largest weight. For instance, the strict second largest weight of {3, 5, 2, 5, 3} is 3.
Input
The first line contains an integer T (T<=3), which means there are T test cases in the input.
For each test case, the first line contains two integers N and M (N, M<=10^5). The second line contains N integers, and the ith integer is the weight of the ith node in the tree (their absolute values are not larger than 10^4).
In next N1 lines, there are two integers a and b (1<=a, b<=N), which means there exists an edge connecting node a and b.
The next M lines describe the operations you have to deal with. In each line the first integer is c (1<=c<=4), which indicates the type of operation.
 If c = 1, there are four integers x, y, a, b (1<= x, y, a, b <=N) after c.
 If c = 2, there are three integers a, b, x (1<= a, b<=N, x<=10^4) after c.
 If c = 3, there are three integers a, b, d (1<= a, b<=N, d<=10^4) after c.
 If c = 4 (it is a query operation), there are two integers a, b (1<= a, b<=N) after c.
All these parameters have the same meaning as described in problem description.
Output
For each test case, first output “Case #x:” (x means case ID) in a separate line.
For each query operation, output two values: the second largest weight and the number of times it occurs. If the weights of nodes on that path are all the same, just output “ALL SAME” (without quotes).
Sample Input


Sample Output


Solution
鞍山赛区是什么鬼辣？？？
「增删边」操作已经告诉我们本题就是 LCT……
而维护次大值的话，只需要同时记录最大值和次大值的信息就行了。这一点跟归并排序有点像 2333
T 了一发发现忘记删文件 IO 了 2333333333333333

