Ramsey theory
The map for "Among Us" is an undirected graph which vertices are rooms and the edges are two-way tunnels between them. The developer of this game, Ramsey, has a theory that a map must satisfy certain properties in order to be fun to play.
There will be k traitors and l ordinary crew members in the game. If there is a l-clique in the graph - a set of l vertices, each pair of which is connected by an edge - then the crew members will simply be distributed between them, and if one of them is killed, all players from neighboring rooms will immediately run, find the murderer and punish him. Such a game would be rather uninteresting.
On the other hand, if the graph has a k-anti-clique - a set of k vertices, each pair of which is not connected by an edge - then traitors will be able to stand at its vertices, lure good players and kill them there, and, most likely, they will manage to remain unnoticed. Such a strategy, according to Ramsey, will also make the game uninteresting.
Write a program that finds a l-clique or k-anti-clique in the graph or determines that they are not in the graph (and then the game promises to be exciting).
Input
The first line contains four numbers n, m, k, l (1 ≤ n ≤ 300 000, * 0* ≤ m ≤ 300 000, 1 ≤ k, l ≤ min(5, n)) - the number of vertices and edges of the graph, as well as the sizes of the required anti-cliques and cliques.
The next m lines contain two integers a[i]
, b[i]
(1 ≤ a[i]
< b[i]
≤ n) - ends of the next edge of the graph. It is guaranteed that all edges are distinct.
Output
If you find a set of vertices that is either a k-anti-clique or an l-clique, print the numbers of all these vertices separated by a space. If there is no such set of vertices, print "-1".
Examples
Note
The first example looks like a pentagon in which all sides are drawn, but no diagonals are drawn. There are no triangles or anti-triangles in it, so the answer is "-1".
In the second and third examples, the graph is empty. The second example requires either finding an anti-edge or a 4-clique at the vertices. The answer will be any pair of different numbers from 1 to 4. In the third example, it's the other way around - you need to find either a 4-anti-clique or an edge. Since there are no edges, the only correct answer to this example is the set of all numbers from 1 to 4 (listed in no particular order).
In the fourth example, a complete graph is given, and the correct answer is any four of its vertices (because it will be its clique). However, a set of one vertex is always both a clique and an anti-clique; therefore, since it is allowed to output a 1-anti-clique in the example, any unimodal set is also a valid answer.