«Contest should be comparable with regional competitions»- they say. Well, with this problem, this one should feel really NEERC.
A b-fold coloring of a graph G is an assignment of sets of colors of size b to vertices of G such that adjacent vertices are assigned with disjoint sets. An a:b-coloring is a b-fold coloring such that all assigned sets of colors are subsets of a universal set of size a.
A cactus is a connected graph in which every edge belongs to at most one simple cycle.
You are given a cactus. Find its a:b-coloring that minimizes the ratio ba among colorings with 1≤b≤1000. If there are multiple suitable a:b-colorings with the smallest possible ratio, output any of them.
The first line contains two integers n and m (2≤n≤1000,1≤m≤1500), the number of vertices and the number of edges in the graph respectively.
Each of the next m lines contains two integers u and v (1≤u,v≤n) describing an edge between vertices u and v.
It is guaranteed that the given graph is a cactus without loops and multiple edges.
In the first line print two integers a and b (1≤a≤106,1≤b≤1000). It can be proven, that in an optimal answer a will never exceed 106 under given limitations.
Each of the next n lines should contain b distinct numbers in the range from 1 to a. i-th of the lines should describe the set of colors assigned to the vertex i in an arbitrary order.