Given an undirected graph, compute the number of vertices of the smallest and largest connected component.
Input consists of several graphs. Each of them starts with the number of vertices and the number of edges , followed by pairs that correspond to an edge between vertices and . It holds that , , vertices are numbered from to , and there are neither repeated edges nor edges of the form .
For each graph, write the minimum and maximum size of its connected components.
Input
3 1 0 2 1 0 6 5 0 1 4 2 2 1 5 3 4 0
Output
1 2 1 1 2 4