A very famous DJ has recently been invited to play at the closing party of a Computer Science conference. To impress the participants, he decided to use a program to choose the songs he would play. The result, however, was a disaster, because the way the program picked songs was quite strange and repetitive.
First, the DJ selected $N$ songs from those available. The program then labels each song with a distinct character from 'A' to 'Z': the $i$-th song is labeled with the $i$-th character of the sequence 'A'-'Z'. The program plays the songs in the order their labels appear in the following infinite string of characters: first come all words of length 1 in lexicographical order, then all words of length 2 in lexicographical order, then all words of length 3, and so on. For $N = 3$, this string begins ABCAAABACBABBBCCACBCCAAAAABAACABAABBABC...
After the party, some people asked the DJ which song was played first. Others wanted to know which one was the 25th, and so on. The DJ remembers nothing but this strange repetition pattern, so he asks you to write a program that answers such queries.
The input contains several test cases. Each test case consists of three lines. The first line contains two integers $N$ and $Q$, the number of songs the DJ chose and the number of queries the participants made ($1 \le N \le 26$ and $1 \le Q \le 1000$). The second line contains the $N$ song titles separated by single spaces (each title is a string of alphanumeric characters, at least 1 and at most 100 characters long). The third line contains a sequence of queries. Each query is a number $k$ ($1 \le k \le 100,000,000$) referring to the $k$-th song played at the party. The end of the input is indicated by $N = Q = 0$.
For each query $k$ in a test case, print a single line with the name of the $k$-th song played at the party. Print a blank line after each test case.