#d1705. Fence Painting

Fence Painting

Fence Painting

Problem Description

There are nn fence planks numbered from 11. The ii-th plank currently has colour aia_i, and you want to repaint the ii-th plank to colour bib_i.

There are mm painters who will work in turn. The jj-th painter will paint one plank with colour cjc_j. You may decide which plank each painter paints, but you cannot leave a painter idle.

Determine whether all planks can be repainted to their target colours; if so, output a plan.

Input Format

Multiple test cases.

The first line contains an integer TT (1≤T≤100001 \le T \le 10000).

For each test case, the first line contains two integers n,mn, m (1≤n,m≤1000001 \le n, m \le 100000) separated by a space.

The next line contains nn integers aia_i (1≤ai≤n1 \le a_i \le n).

The next line contains nn integers bib_i (1≤bi≤n1 \le b_i \le n).

The next line contains mm integers cic_i (1≤ci≤n1 \le c_i \le n).

It is guaranteed that ∑n,∑m≤100000\sum n, \sum m \le 100000.

Output Format

For each test case, if the planks cannot be repainted to the target colours, output one line containing NO.

If they can, first output one line containing YES.

Then output one line with mm integers, indicating which plank (by number) the jj-th arriving painter should paint. There may be multiple valid plans; output any of them.

Sample Input

6
1 1
1
1
1
5 2
1 2 2 1 1
1 2 2 1 1
1 2
3 3
2 2 2
2 2 2
2 3 2
10 5
7 3 2 1 7 9 4 2 7 9
9 9 2 1 4 9 4 2 3 9
9 9 7 4 3
5 2
1 2 2 1 1
1 2 2 1 1
3 3
6 4
3 4 2 4 1 2
2 3 1 3 1 1
2 2 3 4

Sample Output

YES
1
YES
2 2
YES
1 1 1
YES
2 1 9 5 9
NO
NO