题目描述
John Watson always knew that one of the favourite hobbies of Sherlock Holmes was to tinker with ciphers. Though Watson was not that good with ciphers, he learnt a few things being with him. Right now, Watson is in trouble! He has been locked in a room and the only way to get out of the room is through deciphering a known string to get the password. With his knowledge, he finds out that a given string S can be deciphered with a given cipher array A (1-based index) of same length N as follows: Starting from first number in A (i.e. i=1) the 'i'th character in S, has to be swapped with A[i]th character in S. Help him to get out of the room.
Input
First line contains no of test cases T. The description of T test cases follows.
Each test case consists of 3 lines:
Length of string N in the first line, the known string S in the second line, and N space-separated integers of array A in the third line.
Output
For each test case, output in a single line the deciphered text.
Constraints
1 ≤ T ≤ 100
1 ≤ N ≤ 10^5
1 ≤ A[i] ≤ N
Sum of N across all the test cases in a test file will not exceed 10^6
String S contains only lower case English letters
Example
Input:
3
5
abcde
1 2 3 4 5
6
fluxus
6 5 4 3 2 1
8
hrcksleo
5 5 7 5 6 8 7 8
Output:
abcde
fluxus
sherlock
输入格式
见题面
输出格式
见题面