Checkpoint candidates

Given an undirected graph, a set of source vertices, and a set of airport vertices, count the vertices that every source-to-airport path must pass through.

Hard8GraphDFSNo attempts yetTime limit2sMemory limit128 MB

Problem

Coders High hired a group of strong programmers and built an intrusion detection system. The company has many people who know algorithms and security well, so results came quickly.

One day the engineers at Coders High detected an intrusion attempt against the company. They identified every place the attack may have been launched from. The suspects are now trying to escape to an airport.

Assume the suspects are staying at one of the places where the attack may have been launched, and that they reach one of the airports within a finite amount of time. There is no guarantee that they take a shortest route.

Call a place AA a checkpoint candidate when it has the following property.

  • Starting from a place where the attack may have been launched, no airport can be reached without passing through place AA.

So if you wait at a checkpoint candidate, the suspects pass through it sooner or later.

You know every place and every road that joins them, and the engineers handed you the list of places where the attack may have been launched together with the list of places that have an airport. Compute how many checkpoint candidates there are and which places they are.

Input

The first line contains the number of places NN (2N1000002 \le N \le 100\,000) and the number of roads MM (1M2000001 \le M \le 200\,000), separated by a space. The places are numbered from 11 to NN.

Each of the next MM lines describes one road. The ii-th of these lines contains the numbers of the two places the road joins, aia_i and bib_i (1ai,biN1 \le a_i, b_i \le N, aibia_i \ne b_i), separated by a space.

The next line contains the number of places where the attack may have been launched, SS (1SN11 \le S \le N - 1), and the number of places that have an airport, EE (1EN11 \le E \le N - 1), separated by a space.

The next line contains the numbers of the places where the attack may have been launched, s1,s2,,sSs_1, s_2, \dots, s_S, separated by spaces. The last line contains the numbers of the places that have an airport, e1,e2,,eEe_1, e_2, \dots, e_E, separated by spaces. The sis_i are pairwise different, and the eie_i are pairwise different.

All places are connected directly or indirectly. That is, from any place there is always a route to any other place. Also there are no indices iji \ne j with (ai,bi)=(aj,bj)(a_i, b_i) = (a_j, b_j), so at most one road joins any two places.

Output

On the first line, print the number of checkpoint candidates.

On the second line, print the checkpoint candidates in increasing order of their numbers, separated by single spaces. If there is no checkpoint candidate, print an empty second line.

A place sis_i where the attack may have been launched and a place eie_i that has an airport can also be checkpoint candidates.