Tours

No attempts yetTime limit3sMemory limit256 MB

Problem

The Arca Carania Mountain national park is opening up for tourist traffic. The park has a number of sites worth seeing and roads that connect pairs of sites. The park commissioners have put together a set of round tours in the park that visitors can ride buses along. A round tour starts at some site, visits a number of other sites without repeating any, and then returns to where it started. Different tours may start at different sites. Every round tour visits at least 3 different sites. At least one round tour is possible in the park.

For any given road, all buses are operated by a single company. The commissioners do not want to be accused of favoritism, so they want every possible round tour in the park to have exactly the same number of roads assigned to each bus company. They realize this may be hard to achieve. They want to learn which numbers of bus companies allow a valid assignment of companies to roads.

Consider a park with 4 sites and the roads 1-2, 2-3, 3-4, 1-4 and 1-3. It has three round tours: 1-2-3-1, 1-3-4-1 and 1-2-3-4-1. Some company is assigned road 1-3. It must also be assigned some road of the round tour 1-2-3-4-1, say 2-3. But then it is assigned two of the three roads of the round tour 1-2-3-1, and no other company can match this, so there can be no other company. In a park with only one round tour, it is enough to split the roads of that tour evenly among the companies.

A park with 4 sites and 5 roads

Input

The first line contains two integers nn (1n20001 \le n \le 2000), the number of sites in the park, and mm (1m20001 \le m \le 2000), the number of roads between the sites. Each of the next mm lines contains two integers aia_i and bib_i (1ai<bin1 \le a_i < b_i \le n), meaning that sites aia_i and bib_i are connected by a bidirectional road. No pair of sites is listed twice.

Output

Print all integers kk such that the roads can be assigned to kk companies in the desired way. Print them in ascending order on one line, separated by single spaces.