Calvinball team assignment

No attempts yetTime limit1sMemory limit256 MB

Problem

The Calvinball championship is held again this year. One game is played by nn participants with distinct names, and the participants are divided into some number of non-empty teams. Some participants dislike each other. Disliking is symmetric, so if aa dislikes bb, then bb dislikes aa.

The organizers changed the rule for forming teams. Two participants who dislike each other cannot be on the same team, and under that condition the number of teams must be as small as possible.

For example, suppose Calvin, Hobbes, Susie, Tom, Jerry and Batman play the game, 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, because Batman, Tom and Jerry dislike each other and need three different teams. Four teams are not an answer either, because three teams are possible.

Given who dislikes whom, find a division into the smallest possible number of teams. When several such divisions exist, the output section picks one of them.

Input

The first line contains the number of participants nn and the number of mutually disliking pairs mm, separated by a space, where 0n240 \le n \le 24 and 0mn(n1)/20 \le m \le n(n-1)/2. The participants are numbered from 11 to nn.

The ii-th of the next mm lines contains two distinct integers aia_i and bib_i with 1ai,bin1 \le a_i, b_i \le n, meaning that participants aia_i and bib_i dislike each other. The same pair is never given twice.

Output

Print the number of teams tt on the first line. The ii-th of the next tt lines contains the numbers of the participants on team ii in increasing order, separated by spaces. If nn is 00, print only 00 on the first line and no team lines.

Several divisions can use the minimum number of teams, so pick one by the following rule. First fix the team numbers. Team 11 is the team of participant 11, and team jj is the team of the smallest-numbered participant who is not on teams 11 through j1j-1. Let cic_i be the number of the team that participant ii is on. Among all divisions using the minimum number of teams, print the one whose sequence c1,c2,,cnc_1, c_2, \dots, c_n comes first in lexicographic order.