Calvinball team assignment

No attempts yetTime limit1sMemory limit256 MB

Problem

The Calvinball championship is on again. A game is played by nn players with distinct names, and the players are divided into some number of non-empty teams. Some players dislike each other. Disliking is symmetric: if player aa dislikes player bb, then bb dislikes aa.

The organizers changed the rule for building teams. Two players who dislike each other may not be on the same team, and subject to that, 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 enough: Batman alone, Tom with Susie, and Calvin with Hobbes and Jerry. Two teams are not enough, because Batman, Tom, and Jerry dislike one another and must go to three different teams. Four teams is not an answer either, because three teams work.

Given who dislikes whom, produce a division of the players into teams that follows the rule.

Input

The first line contains the number of players nn and the number of pairs of players who dislike each other mm. (1n151 \le n \le 15, 0mn(n1)/20 \le m \le n(n-1)/2)

Players are numbered from 11 to nn. Each of the next mm lines contains two different integers aia_i and bib_i, meaning that players aia_i and bib_i dislike each other. (1ai,bin1 \le a_i, b_i \le n, aibia_i \ne b_i) No pair is given twice, and the two numbers of a pair come in either order.

Output

Print the 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.

Several divisions can use the minimum number of teams, so the team numbers are fixed as follows. Let cic_i be the number of the team that player ii belongs to. Among all valid assignments, print the one whose sequence (c1,c2,,cn)(c_1, c_2, \dots, c_n) is lexicographically smallest. In that assignment every team from 11 to tt holds at least one player.