#bzoj4116. Tours

Tours

Question Description

Given an undirected graph with nn vertices and mm edges, you need to choose a number of color types kk, and then use these kk colors to color each edge. For any simple cycle in the graph, the number of edges of each color should be the same. Find all feasible kk

Input format

The first line contains two positive integers n,mn, m

Next, mm lines, each line containing two positive integers x,y(1x<yn)x,y(1\le x<y\le n) representing an undirected edge

The data ensures no multiple edges and no self-loops

Output format

Output all possible values of kk on one line

Example

Note: Input 66 66 11 22 22 33 11 33 11 44 22 55 33 66 in increasing order

6 6
1 2
2 3
1 3
1 4
2 5
3 6
1 3

Data Range and Conventions

For 100%100\% of the data: n,m2000n,m\le 2000.