Calvinball team assignment

No attempts yetTime limit1sMemory limit256 MB

Problem

The Calvinball championship is held in the Czech Republic again this year. A game of Calvinball is played by nn players with distinct names, split into some number of non-empty teams. Some players dislike each other. Disliking is symmetric: if player aa dislikes player bb, then bb also dislikes aa.

The championship organizers changed the team selection rule. No two players who dislike each other may be on the same team, and among the splits that respect this, the number of teams must be as small as possible.

For example, suppose Calvin, Hobbes, Susie, Tom, Jerry and Batman play, Batman dislikes the other five, and Tom dislikes Jerry and Hobbes. Three teams are then enough: Batman alone, Tom with Susie, and Calvin with Hobbes and Jerry. Two teams are impossible, because Batman, Tom and Jerry dislike each other and must go to three different teams. Four teams is not the answer either, because a smaller number works.

Given the dislike relation, find a split into the smallest number of teams. Several such splits can exist, so the output rule below picks exactly one of them.

Input

The first line contains the number of players nn and the number of disliking pairs mm. (1n151 \le n \le 15, 0mn(n1)/20 \le m \le n(n-1)/2) The players are numbered from 11 to nn.

Each of the next mm lines contains two distinct integers aa and bb (1a,bn1 \le a, b \le n, aba \ne b), meaning that players aa and bb dislike each other. No pair is given twice.

Output

Print the minimum number of teams tt on the first line. On the ii-th of the next tt lines, print the numbers of the players on team ii in increasing order, separated by single spaces.

When several splits use tt teams, print the one this rule selects. Let cic_i be the number of the team that player ii joins. Among all splits into tt teams, print the one whose sequence (c1,c2,,cn)(c_1, c_2, \ldots, c_n) is lexicographically smallest. Under this rule player 1 always joins team 1, and the smallest player number on a team grows as the team number grows.