You are given a graph with vertices and edges. Your task is to paint each vertex with one of colors. Your coloring must be such that no vertex has more than adjacent vertices with the same color as .
Input consists of several cases. Every case begins with , , , and . Follow the edges. There are no repeated edges, nor edges connecting to . The vertices are numbered starting from zero. Assume , , and that the number of neighbors of every vertex is strictly less than , which will be at most 20.
Print lines for every case. In the -th line, print the vertices such that their color is . Print the vertices in any order, and separated by one space. Print an additional final line with 10 asterisks after each case. If there are several solutions, you may print any of them. If there is no solution, print an elegant proof that .
Input
3 1 1 1 2 0 2 1 0 0 4 3 0 4 0 1 1 2 2 3 3 0 4 3 0 4 0 1 1 2 2 3 3 0 4 2 1 4 0 1 2 1 0 2 0 3 6 2 2 15 0 1 0 2 0 3 0 4 0 5 1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5
Output
0 1 2 ********** 0 1 ********** 3 1 0 2 ********** 3 1 0 2 ********** 0 2 1 3 ********** 0 2 4 1 3 5 **********