You are given a simple undirected graph whose vertices are numbered from to .
A matching is a set of edges in which no two edges share an endpoint. Find the maximum possible number of edges in a matching and output one matching attaining that maximum.
Input
The input is given in the following format.
For each (), there is an edge connecting vertices and .
Output
On the first line, print the size of a maximum matching.
On each of the next lines, print the two endpoints of an edge in the matching.
Every printed pair must be an edge of the input graph, and no vertex may appear more than once. If multiple answers exist, print any of them.
Constraints
- .
- .
- ().
- ().
- No unordered pair of vertices appears more than once.
Subtasks
Samples
The edges and do not share an endpoint. Since the graph has four vertices, no matching can have more than two edges.
In a triangle, every two distinct edges share a vertex, so the maximum matching size is .