#P2247. ACOJ Cloud Judging Network Disconnection

    ID: 15525 Type: Default 1000ms 256MiB

ACOJ Cloud Judging Network Disconnection

ACOJ Cloud Judging Network Disconnection

The ACOJ main server is forced to use a cloud judging service provided by a network of sub-stations. There are $n$ stations (including the main station) and $m$ bidirectional direct connections among some pairs of stations. However, due to geographical and other constraints, not every two stations can communicate directly.

Some station administrators are die-hard fans of SOL, and these so‐called good stations will offer their server resources freely. Others, who dislike SOL, will disable their cloud service – these bad stations exist in the system but do not forward communications or participate in judging.

SOL’s investigation shows that there may be at most $k$ bad stations in the system, and that incidentally, if those $k$ stations turn bad then the cloud network will lose connectivity! In other words, if you remove a certain set of $k$ stations, the remaining network is not fully connected (note that a graph with at most one vertex is defined to be connected).

Your task is to help SOL: find any set of $k$ station indices such that if they were to malfunction (i.e. be removed), the network becomes disconnected. It is guaranteed that the input graph has at least one set of $k$ nodes which, when removed, will cause the remaining graph (with at least 2 nodes) to become disconnected.

Note: A set S of vertices is a vertex cut if after removing all the vertices in S, the remaining graph is not connected (and contains at least 2 nodes).

inputFormat

The first line contains three integers n, m, and k (with n - k \ge 2), representing the number of stations, the number of direct connections, and the number of stations to remove, respectively.

Then follow m lines, each containing two integers u and v (1 ≤ u, v ≤ n, u \neq v) indicating there is a direct bidirectional connection between stations u and v. There is at most one direct connection between any pair of stations.

outputFormat

Output k distinct integers (separated by spaces) – the indices of a set of stations which, if removed, will make the remaining network disconnected.

sample

4 3 1
1 2
2 3
3 4
2

</p>