Network
문제
Rui Yuan the Duck is building a new network to run all of his new applications. This network is comprised of servers numbered from to . There are also network links, numbered from to connecting these servers.
The -th of these links connects servers and bidirectionally. It is guaranteed that it is possible to travel from any server to any other server using only the servers and network links.
Initially, all servers are active. Rui Yuan has applications running, which have distinct IDs from to . Each application has databases. Application has databases in servers and (which may be the same server). It is possible for two different applications to have a database on the same server.
In order for application to work, both of its databases must be connected through network links and active servers. To be precise, application is working if both of the following conditions are met:
- Servers and are both active.
- One can travel from server to server using only network links and active servers.
Rui Yuan has asked Benson the Rabbit to test his network. Using his hacking skills, Benson can select any set of servers and deactivate all of them simultaneously. The robustness of the network is the minimum number of servers that must be deactivated to ensure all applications are not working.
Benson is very busy, so he wants you to help him compute the robustness of the network and the selection of servers he should deactivate so that he doesn’t waste time deactivating more servers than needed.
입력
The first line of input contains two integers, and .
lines will follow. The -th line contains two integers, and respectively, which are the servers connected by the -th network link.
Another lines will follow. The -th line contains two integers, and respectively, which are the servers storing the databases for application .
출력
Output two lines. The first line should contain a single integer, representing the robustness of the network, which we will denote as .
The second line should contain integers, representing the servers that should be deactivated. All integers must be pairwise distinct. You may output them in any order.
예제
예제 1
9 4 1 2 2 3 2 6 3 4 4 5 4 7 6 9 7 8 6 2 5 3 4 8 5 9
2 4 2
예제 2
6 5 1 2 2 3 4 1 3 5 4 6 1 1 2 2 3 3 2 2 4 4
4 3 2 4 1
예제 3
8 3 1 2 2 3 3 4 4 5 5 6 6 7 7 8 3 5 8 5 4 4
2 4 6
예제 4
6 2 1 2 1 3 1 4 1 5 1 6 2 2 5 6
2 2 1