Input contains multiple cases. Each case contains several lines.
The first line contains two integers N, M(N<=100,000, M<=151,000), representing the number of forks and the number of branches in the tree.
The following M lines each has three integers u, v and c, which means fork u and fork v are connected by a branch, if you want to cut it, you have to cost c (arbitrary two c will be different, c<=200,000).
The next line contains an integer P, representing the operations following.
"G x y" which means the fork x will grow y more fruits ;
"C x" which means girls will pick all fruits on the fork x;
"Q x" which means girls want to know the number of fruits in the sub-tree above the fork x, including the fruits (if exists) on the fork x.
Note the tree is empty at the beginning, every number will not exceed the range of integer.