Question

Sort it

1

5 1

2 3 4 6 1

2

2 3 4 1 6

Initially A = [2, 3, 4, 6, 1]. After sorting the suffix of length 2, the array changes to A = [2, 3, 4, 1, 6].

You are given arrays A and B of sizes N and M respectively, such that 1 ≤ B

Output the resultant array A after all operations. Note that a suffix of length X denotes the subarray consisting of last X elements of the array.

_{i}≤ N. For each 1 ≤ i ≤ M. Sort the suffix of length B_{i}in array A in non-decreasing order.Output the resultant array A after all operations. Note that a suffix of length X denotes the subarray consisting of last X elements of the array.

Input

The first line consists of a single integer T, denoting the number of test cases.

The first line of each test case consists of two space-separated integers N and M, denoting the sizes of arrays A and B.

The second line of each test case consists of N space separated integers, denoting an array A.

The third line of each test case consists of M space separated integers, denoting an array B.

1 ≤ T ≤ 10

1 ≤ N, M ≤ 10

1 ≤ A

1 ≤ B

The first line of each test case consists of two space-separated integers N and M, denoting the sizes of arrays A and B.

The second line of each test case consists of N space separated integers, denoting an array A.

The third line of each test case consists of M space separated integers, denoting an array B.

**Constraints**1 ≤ T ≤ 10

^{3}1 ≤ N, M ≤ 10

^{3}1 ≤ A

_{i}≤ 10^{7}1 ≤ B

_{i}≤ NOutput

For each test case, output N space-separated integers, denoting the resultant array A after all operations.

Example

**Sample Input**

1

5 1

2 3 4 6 1

2

**Sample Output**

2 3 4 1 6

**Explanation**

Initially A = [2, 3, 4, 6, 1]. After sorting the suffix of length 2, the array changes to A = [2, 3, 4, 1, 6].