Mr. AH got his special name from his favorite game, which is called On the Road to Happiness. This game is played with a string s consisting of n uppercase English letters, b beautiful cards, and a magical wand.
A beautiful card '_x y c_' can be used to swap the letters in positions x and y after paying c coins. Mr. AH can use every beautiful card infinitely, but he must pay each time he wants to use it.
Some of the beautiful cards are interesting, a beautiful card '_x y c_' is said to be interesting if Mr. AH cannot move the letter in position x to position y (or the letter in position y to position x) using any sequence of cards unless this card is among them.
The magical wand allows Mr. AH to use the beautiful cards without paying anything, except for the interesting cards, Mr. AH must respect these cards and pay for using them. Mr. AH can use the wand as much as he needs.
A position in the given string is said to be happy if it initially contains the letter '_A_'. The goal of the game is to find the minimum cost to move all letters '_H_' in the string to the happy positions, such that each happy position can contain at most one '_H_' letter.
Mr. AH thinks that he is the king of this game, but he wants to see other players play it to prove that. So Mr. AH asked you to play the game, can you?
The first line contains a single integer T (1 ≤ T ≤ 100) specifying the number of test cases.
The first line of each test case contains two integers n and b (1 ≤ n ≤ 105, 0 ≤ b ≤ 2 × 105), in which n is the length of the string and b is the number of the beautiful cards.
The second line of the each test case contains a string s of length n, consisting of uppercase English letters.
Then b lines follow, each line contains three integers x, y and c (1 ≤ x, y ≤ n, x ≠ y, 1 ≤ c ≤ 100), giving the beautiful cards. It is guaranteed that for each two positions x and y, there is at most one card that can swap the letters in them.
The number of happy positions is between 0 and (inclusive), and it always equals the number of positions that contain the letter '_H_'.
It is guaranteed that you can move any letter from its position to any other position.
For each test case, print a single line containing the minimum cost to move all letters '_H_' in the string to the happy positions. It is guaranteed that the answer always exists.
In the second test case, the only interesting beautiful card is '_4 5 7_', and the letters can be moved by using two sequences of beautiful cards:
The magic wand will be used on all cards except for the only interesting card, which will be used twice leading to a total cost of 14.
## Input
The first line contains a single integer T (1 ≤ T ≤ 100) specifying the number of test cases.The first line of each test case contains two integers n and b (1 ≤ n ≤ 105, 0 ≤ b ≤ 2 × 105), in which n is the length of the string and b is the number of the beautiful cards.The second line of the each test case contains a string s of length n, consisting of uppercase English letters. Then b lines follow, each line contains three integers x, y and c (1 ≤ x, y ≤ n, x ≠ y, 1 ≤ c ≤ 100), giving the beautiful cards. It is guaranteed that for each two positions x and y, there is at most one card that can swap the letters in them.The number of happy positions is between 0 and (inclusive), and it always equals the number of positions that contain the letter '_H_'.It is guaranteed that you can move any letter from its position to any other position.
## Output
For each test case, print a single line containing the minimum cost to move all letters '_H_' in the string to the happy positions. It is guaranteed that the answer always exists.
[samples]
## Note
In the second test case, the only interesting beautiful card is '_4 5 7_', and the letters can be moved by using two sequences of beautiful cards: '_1 2 5_', '_2 4 6_', '_4 5 7_', '_5 7 2_', '_7 8 2_' '_1 2 5_', '_2 4 6_', '_4 5 7_', '_5 6 9_' The magic wand will be used on all cards except for the only interesting card, which will be used twice leading to a total cost of 14.
**Definitions**
Let $ n \in \mathbb{Z}^+ $, $ n \geq 2 $.
Let $ A = \{a_1, a_2, \dots, a_n\} $ be a set of positive integers, each given in binary notation.
Let $ L = \max_{i} |a_i| $ be the maximum bit-length of any $ a_i $, where $ |a_i| $ denotes the number of bits in the binary representation of $ a_i $.
A set $ B = \{b_1, b_2, \dots, b_n\} $ is *beautiful* if for every bit position $ j \geq 0 $, at most one $ b_i $ has a 1 in position $ j $ (i.e., the bitwise OR of $ B $ equals the sum of $ B $).
**Constraints**
1. $ 2 \leq n \leq 300{,}000 $
2. Each $ a_i $ is given in binary without leading zeros.
3. Total length of all binary strings $ \leq 300{,}000 $.
4. For all $ i \in \{1, \dots, n\} $, $ b_i \geq a_i $.
**Objective**
Minimize $ \sum_{i=1}^n b_i $ over all beautiful sets $ B = \{b_1, \dots, b_n\} $ satisfying $ b_i \geq a_i $ for all $ i $.
Output the binary representation of the minimum possible sum $ \sum_{i=1}^n b_i $, without leading zeros.