Problem2373--CF1706A - Another String Minimization Problem

2373: CF1706A - Another String Minimization Problem

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

You have a sequence a1,a2,…,ana1,a2,…,an of length nn, consisting of integers between 11 and mm. You also have a string ss, consisting of mm characters B.

You are going to perform the following nn operations.

  • At the ii-th (1≤i≤n1≤i≤n) operation, you replace either the aiai-th or the (m+1−ai)(m+1−ai)-th character of ss with A. You can replace the character at any position multiple times through the operations.

Find the lexicographically smallest string you can get after these operations.

A string xx is lexicographically smaller than a string yy of the same length if and only if in the first position where xx and yy differ, the string xx has a letter that appears earlier in the alphabet than the corresponding letter in yy.

Input

The first line contains the number of test cases tt (1≤t≤20001≤t≤2000).

The first line of each test case contains two integers nn and mm (1≤n,m≤501≤n,m≤50) — the length of the sequence aa and the length of the string ss respectively.

The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤m1≤ai≤m) — the sequence aa.

Output

For each test case, print a string of length mm — the lexicographically smallest string you can get. Each character of the string should be either capital English letter A or capital English letter B.

Input


Output


Sample Input Copy

6
4 5
1 1 3 1
1 5
2
4 1
1 1 1 1
2 4
1 3
2 7
7 5
4 5
5 5 3 5

Sample Output Copy

ABABA
BABBB
A
AABB
ABABBBB
ABABA

Source/Category