Time limit
2s
Memory limit
128 MB
After the students became too noisy, the director decided to split them into classes.
The students strongly disliked being separated from close friends. To calm them down, the director allowed students in different classes to talk through an internet messenger.
For two students to talk through the messenger, each of them must know the other's messenger ID. Not every pair of students knows each other's ID.
The director wants to create as many classes as possible. Any two students placed in different classes must therefore know each other's messenger ID.
Given the pairs of students who know each other's messenger IDs, determine the maximum number of classes and the size of each class in such an arrangement.
The first line contains two integers n and m: the number of students and the number of pairs of students who know each other's messenger IDs. (2 ≤ n ≤ 100,000, 1 ≤ m ≤ 2,000,000)
Each of the next m lines contains two integers a and b, meaning students a and b know each other's messenger IDs. Each student number is an integer from 1 to n.
On the first line, print the maximum possible number of classes.
On the second line, print the sizes of the classes in ascending order.
In the public test, one valid optimal arrangement puts student 4 alone, students 5 and 7 together, and the remaining four students together.