You are given a graph with vertices and edges, where 1 \leq n \leq 1000 and 1 \leq m \leq 7000.
Your task is to determine the minimum number of edges that must be added to make the graph connected, and specify these edges.
The input begins with the integers and , followed by pairs of integers. Each pair represents an edge in the graph, indicating the start and end vertices of that edge.
First, output the minimum number of edges that need to be added. Then, for the next lines, provide the two vertices that form each new edge.
Example 1