You are given number of nodes, N, and number of edges, M, of a undirected connected graph. After adding each edge, print the size of all the connected components (in increasing order).
Input:
First line contains two integers, N and M, number of nodes and number of edges.
Next M lines contains two integers each, X and Y, denoting that there is an edge between X and Y.
Output:
For each edge, print the size of all the connected components (in increasing order) after adding that edge.
Constraints:
1≤N≤103
1≤M≤N−1
1≤X,Y≤N
After adding first edge the connected components are [1, 2], 3, 4, 5 and their sizes are 1, 1, 1, 2.
After adding second edge the connected components are [1, 2], [3, 4], 5 and their sizes are 1, 2, 2.
After adding third edge the connected components are [1, 2]. [3, 4, 5] and their sizes are 2, 3.
After adding the fourth edge the connected component is [1, 2, 3, 4, 5] and its size is 5 .