Cactus Revisited

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

문제

«Contest should be comparable with regional competitions»- they say. Well, with this problem, this one should feel really NEERC.

A bb-fold coloring of a graph GG is an assignment of sets of colors of size bb to vertices of GG such that adjacent vertices are assigned with disjoint sets. An aa:bb-coloring is a bb-fold coloring such that all assigned sets of colors are subsets of a universal set of size aa.

A cactus is a connected graph in which every edge belongs to at most one simple cycle.

You are given a cactus. Find its aa:bb-coloring that minimizes the ratio ab\frac{a}{b} among colorings with 1b10001 \leq b \leq 1000. If there are multiple suitable aa:bb-colorings with the smallest possible ratio, output any of them.

입력

The first line contains two integers nn and mm (2n1000,1m15002 \leq n \leq 1000, 1 \leq m \leq 1500), the number of vertices and the number of edges in the graph respectively.

Each of the next mm lines contains two integers uu and vv (1u,vn1 \leq u, v \leq n) describing an edge between vertices uu and vv.

It is guaranteed that the given graph is a cactus without loops and multiple edges.

출력

In the first line print two integers aa and bb (1a106,1b10001 \leq a \leq 10^6, 1 \leq b \leq 1000). It can be proven, that in an optimal answer aa will never exceed 10610^6 under given limitations.

Each of the next nn lines should contain bb distinct numbers in the range from 1 to aa. ii-th of the lines should describe the set of colors assigned to the vertex ii in an arbitrary order.