404679: GYM101608 C A message for you!

Memory Limit:256 MB Time Limit:3 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. A message for you!time limit per test3 secondsmemory limit per test256 megabytesinputscoreboard.inoutputstandard output

You’re participating in the ACM JCPC for the first time. Your team solved k out of the 13 problems. Since your last successful submission, you have been trying to solve new problems with no luck.

After all the frustration from the wrong answers, you decided to quit. You raised your head looking for a volunteer, then noticed a big white screen with some red and green dashes. You put your glasses on and, it is a scoreboard! You didn't know this contest has a scoreboard! Now that you do, you noticed that some problems have been solved by many teams! You decided to focus and try to solve the problem that has been solved by the maximum number of teams.

Input

The first line of input contains a single integer T (1 ≤ T ≤ 53235), the number of test cases.

The first line of each test case contains a single integer k (1 ≤ k < 13), the number of problems your team successfully solved.

The second line contains a string of k distinct uppercase English letters that represent the problems your team solved. The letters are given in the alphabetical order. Each problem from 1 to 13 has a corresponding letter from 'A' to 'M'.

The third line contains 13 integers t1, t2, ..., t13 (0 ≤ ti ≤ 92), ti is the number of teams that solved problem the ith problem.

It is guaranteed that the input is valid, and there's at least one problem not solved by your team and solved by other teams.

Output

For each test case, print an uppercase letter that represents the next problem to be solved, which is the one that has been completed by the maximum number of teams.

It is guaranteed that the answer is unique.

ExampleInput
3
2
CE
3 0 47 0 76 0 0 2 0 0 0 0 0
7
ADEFHLM
1 1 2 1 1 1 1 1 0 1 1 1 1
2
DG
35 14 40 13 11 18 1 7 41 29 8 19 43
Output
A
C
M

加入题单

算法标签: