Social Distancing

아직 제출이 없습니다시간 제한10초메모리 제한512 MB

문제

Two things ought to be said about students: they hate to do more work than necessary, and love distancing themselves from others. The former is probably why the department forms a tree (building a corridor between two indirectly connected rooms would be a waste of time); the latter is why they thrive during the ongoing pandemic. Now social distancing is no longer a luxury - it's the norm!

However, tree-structured buildings and distancing yourself from others don't exactly go hand-in-hand. Currently there are kk students in some of the rooms, and due to a distancing policy there is at most one student per room. What is more, no two students reside in rooms directly connected by a corridor.

The ICPC competition is starting soon, and students rush to take seats at the computers scattered around the department. There are kk computers -- as many as there are students -- located in some of the rooms; moreover, to make distancing possible, no two computers are located in the same room and no two directly connected rooms both have a computer. The students can assign themselves to computers arbitrarily, but they have to maintain social distancing at all times -- so getting them to where they should be can be tricky, if not impossible.

You are a ruthless ICPC organizer, and the creator of the ultimate killer problemset. Watching students run around frantically, you realize a horrible truth: if the students don't reach their rooms in time, they will not be able to take part in the competition, and thus all the hard work on preparing unsolvable problems will go to waste! Surely you cannot allow this.

Given the current positions of students and the positions of computers, design a sequence of operations that moves every student to a room with a computer. Every such operation should move a student to an adjacent room; after every operation no two students should be in the same room or in two adjacent rooms. The remaining time before the competition starts permits you to perform at most 4n24n^2 moves, where nn is the number of rooms. It may as well be that your task is impossible, but there's only one way to find out...

입력

The first line of input contains the number of test cases zz (1z100,0001 \leq z \leq 100\\,000). The descriptions of the test cases follow.

The first line of a test case contains a single integer nn (2n2,0002 \leq n \leq 2\\,000) -- the number of rooms at the department.

The next n1n - 1 lines contain two integers u_iu\_i, v_iv\_i each (1u_iv_in1 \leq u\_i \neq v\_i \leq n) -- two rooms connected by a corridor. It is guaranteed that the described corridors form a tree (a connected graph without cycles).

The next line contains a single integer kk (1k<n1 \leq k < n) -- the number of students (and computers).

The next line contains integers s_1,...,s_ks\_1, ..., s\_k (1s_1<s_2<...<s_kn1 \leq s\_1 < s\_2 < ... < s\_k \leq n) -- the initial locations of the students.

The next line contains integers c_1,...,c_kc\_1, ..., c\_k in a similar format, denoting rooms with computers.

It is guaranteed that there is at least one student located in a room without a computer.

The sum of n2n^2 over all test cases does not exceed 41074 \cdot 10^7.

출력

For each test case, output "YES" (without quotes) if it's possible to move students to rooms with computers while maintaining social distancing, and "NO" otherwise. In the former case, in the following lines print any valid solution. The solution description should start with a single integer mm (1m4n21 \leq m \leq 4 \cdot n^2) denoting the number of moves. Then mm lines should follow, each describing a single move with two integers a_ia\_i, b_ib\_i (1a_ib_in1 \leq a\_i \neq b\_i \leq n), with the meaning that a student who is currently in room a_ia\_i should move to room b_ib\_i, which is connected with a_ia\_i by a corridor. 

You don't need to minimize solution length.