You are given 2n distinct points on a plane. Point i has integer coordinates (x_i,y_i).
Points i and j are a friendly pair if either x_i=x_j or y_i=y_j.
Form n pairs of points. Every point must belong to exactly one pair. The number of friendly pairs among your n pairs must be maximized.
Each test contains multiple test cases. The first line contains the number of test cases t (1≤t≤104). The description of the test cases follows.
The first line of each test case contains a single integer n (1≤n≤105).
The i-th of the next 2n lines contains two integers x_i and y_i, denoting the coordinates of the i-th point (−109≤x_i,y_i≤109). All points are distinct.
It is guaranteed that the sum of n over all test cases does not exceed 105.
For each test case, print a non-negative integer k, denoting the maximum possible number of friendly pairs.
In the i-th of the next n lines, print two integers a_i and b_i, denoting a pair formed by points a_i and b_i (1≤a_i,b_i≤2n; a_i=b_i).
Every integer from 1 to 2n must appear among a_i and b_i exactly once. The number of indices i such that points a_i and b_i are a friendly pair must be equal to k.