Twinning Totem
시간 제한2초메모리 제한2048 MB
연결된 그래프가 주어질 때, 각 질의 루트 u에 대해 u에서 v로 가는 두 신장 트리 경로가 양 끝점만 공유하도록 하는 두 신장 트리가 존재하는지 판정하고, 존재하면 출력한다.
문제
"Ori, this is a Map Stone, one of the many ancient markers created to chart the forest of Nibel as it grew."

The Map Stone that Ori meets today is different from the others. The totem has two sides, and each side has hollows with scratches. Each scratch connects two hollows, and the hollows and the scratches on the two sides are the same. Each hollow can pass through the stone so that, if we put something on one side, we could also see it on the other side. However, the scratches are the same but cannot pass through, so we can put different things on two sides for each scratch.
Ori puts one Life Cell into hollow and Energy Cells into the other hollows. Now, on each side, Ori needs to select scratches and inject light to them to form a spanning tree rooted in . The two resulting trees should have the following property: for each Energy Cell, if it flows its energy to the Life Cell along light scratches on one side, and then flows back along the light scratches on the other side, no other Energy Cell will be passed twice.
Could Ori find two trees with the required properties?
입력
The first line contains two integers and (, , ) denoting the number of hollows and the number of scratches of the totem , respectively.
For the next lines, the -th line contains two integers and () denoting a scratch connecting hollow and hollow .
The next line contains an integer () denoting the number of Ori's attempts.
For the next lines, the -th line contains an integer () denoting the hollow where Ori puts the Life Cell in the -th attempt.
It is guaranteed that is a connected graph without self-loops or multiple edges, and that .
출력
For each attempt of Ori, if no solution exists, output "No" (without quotes) on the first line.
Otherwise, output "Yes" (without quotes) on the first line. Then, output lines to describe the two spanning trees.
For the first of these lines, the -th line must contain two integers and () separated by a space, denoting a selected scratch connecting and . The scratches must form the first spanning tree of .
The next lines must describe the second spanning tree of in the same format.
Your answer will be accepted only when the two trees you output are valid spanning trees of and meet the requirements in the problem description: for any such that , the two simple paths from to in the two trees have no common nodes except their endpoints and .
힌트
For the first example:

- For hollow , the paths in the two trees are and .
- For hollow , the paths in the two trees are and .
- For hollow , the paths in the two trees are and .