Interesting Coloring

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Given is an undirected simple connected graph, consisting of NN vertices and MM edges.

The vertices of this graph are enumerated by sequential integers from 11 to NN, and the edges are enumerated by sequential integers from 11 to MM, respectively. Edge ii connects vertex u_iu\_i and vertex v_iv\_i.

The following special property holds for this graph: for every edge ii (1iM1 \le i \le M), there exists a path connecting u_iu\_i and v_iv\_i that does not contain this edge. We will call such path a bypass path of edge ii.

There may be more than one bypass path for the same edge.

We will color the edges by colors enumerated by sequential integers from 11 to MM, assigning exactly one color to every edge. Some colors may be left unused, others may be used more than once.

The coloring of the edges is called interesting if the following properties hold:

  • If two edges have a common vertex, their colors are different.
  • For every edge, there exists a special bypass path: a bypass path containing the edges colored with no more than 88 different colors.

Your task is to find an interesting coloring and, for each of the MM edges, print any set of colors that can be used to build a special bypass path for that edge.

It can be shown that, under the constraints above, there exists at least one interesting coloring.

입력

The first line of input contains two integers NN and MM (3N55553 \le N \le 5555, 3Mmin(N(N1)/2,9999)3 \le M \le \min (N (N - 1) / 2, 9999)).

The ii-th of the MM following lines describes the ii-th edge and contains two integers u_iu\_i and v_iv\_i (1u_i<v_iN1 \le u\_i < v\_i \le N).

You may assume that each pair (u,v)(u, v) appears in the list at most once, that the given graph is connected and that, after removal of any edge (u,v)(u, v), there still exists a bypass path connecting uu and vv.

출력

Print any interesting coloring in the following format.

On the first line, print MM integers. The ii-th of these integers, C_iC\_i, must be the color of the ii-th edge (1C_iM1 \le C\_i \le M).

Then print MM lines. The ii-th of these lines describes the color set of the special bypass path for edge ii. This line must start with the integer k_ik\_i (1k_i81 \le k\_i \le 8): the number of the colors in the list. It must be followed by k_ik\_i pairwise distinct integers between 11 and MM: the list of colors. The colors can be printed in any order. There must exist a special bypass path between u_iu\_i and v_iv\_i which does not use any colors except the colors in the list. Note that this means the list of colors does not have to be the minimal possible, and there can even be a path that uses only a part of the list: the checking program only makes sure that the listed colors are sufficient.

힌트

In the example, there are two bypass paths for the first edge.

The longer one contains 99 colors (from 22 to 1010), so it is not special.

The shorter one consists of the edges 22, 33, and 1111 (colors 22, 33, and 55), so it is special.