I I U P C   2 0 1 4

 

Problem J: Mobile SMS

 

 

 

Ali is known as very much stingy. He bought an old second-hand mobile phone. He usually uses the mobile phone to receive phone calls from others and rarely makes a phone call. Suddenly, he observes that sending a mobile SMS is much cheaper than making a phone call. So he always sends a mobile SMS instead of making a phone call. Currently, his mobile phone display has got a problem that it shows nothing on the screen. It is difficult for him to write a mobile SMS. But he knows the number arrangement of his mobile keypad. Now he asks your help to find out the text he has keyed in while writing the SMS. He will let you know which key he has pressed and how many times. The keypad arrangement of his mobile is given in the following picture; ‘_’ represents the space.

 

 

 

 

Input

 

The input file consists of several test cases. The first line of the input file contains a single integer T<1000 indicating the number of test cases. Then T test cases follow. Each test case starts with a positive integer 5 ≤ L ≤ 100, which is the length of the message. Each of the next two lines contains L positive integers. First line contains 0 ≤ Ni ≤ 9, 1 ≤ i ≤ L and second line contains 1 ≤ Pi ≤ 4, 1 ≤ i ≤ L. Ni are the keypad numbers which he types and Pi  represents how many times he presses the Nkey.

 

 

Output

 

For each set of input produce one line of output “message”, where message indicates the desired mobile SMS. See the sample input output for further clarification.

 

 

 

 

 

Sample Input

Output for Sample Input

 

2

17

9 3 5 2 6 6 3 0 8 6 0 4 4 8 7 2 1

1 2 3 3 3 1 2 1 1 3 1 3 3 2 1 3 1

12

4 6 9 0 2 7 3 0 9 6 8 1

2 3 1 1 1 3 2 1 3 3 2 3

welcome to iiupc.

how are you?

 

 

Problem Setter: Saifur Rahaman

Alternate Solution: Tanveer Ahsan