You have a string S consisting of N uppercase letters. This is no ordinary string, however — it's a rainbow string! Every letter has a colour, one of red, green, or blue (it might be ambitious to call this a rainbow, but close enough). The colour of the ith letter in S is indicated by the ith letter in a secondary string C (which also consists of N uppercase letters), with the three possible values "R", "G", and "B" representing the colors red, green, and blue respectively.

You'd like to answer Q questions about your rainbow string. The ith question asks:

"What's the {Ki}th lexicographically smallest substring of S which has length Li, includes at least one green letter, and includes no red letters?"

Note that, when considering the list of valid substrings of which to determine the {Ki}th lexicographically smallest one, substrings which are equal to one another but occur at different positions in S are distinct! Additionally, Ki is guaranteed to be no larger than the number of such valid substrings.

For example, consider S = "ABABAB", C = "GGBGRG", and Li = 2. The lexicographically-sorted list of valid substrings of S (those which have length 2, include at least one green letter, and include no red letters) is as follows:

  1. AB (starting at index 1)
  2. AB (starting at index 3)
  3. BA (starting at index 2)

Therefore, if Ki = 2, the answer would be "AB". Ki can be no larger than 3 in this example.

To reduce the size of the output, you should simply output 26 integers, with the ith of them being the total number of times that the ith letter of the alphabet appears throughout the answers to the Q questions.

Input

Input begins with an integer T, the number of rainbow strings you own. For each rainbow string, there is first a line containing the space-separated integers N and Q. The second line contains the length-N string S denoting the alphabetic characters in the rainbow string. The third line contains the length-N string C denoting the colours of each letter of the rainbow string, as described above. Then, Q more lines follow, the ith of which contains the space-separated integers Li and Ki.

Output

For the ith rainbow string, print a line containing "Case #i: " followed by 26 space-separated integers denoting the frequency of each letter amongst the answers to all of the questions, as described above.

Constraints

1 ≤ T ≤ 55
1 ≤ N ≤ 200,000
1 ≤ Q ≤ 400,000
1 ≤ Li, KiN

Explanation of Sample

For the first string, the answers to the three questions are "AB", "AB", and "BA" respectively. "A" and "B" each show up 3 times in these answers.