Tree

No attempts yetTime limit1sMemory limit128 MB

Problem

Given nn points in the plane with target degrees did_i where di=2n2\sum d_i = 2n-2, draw a straight-line tree without crossings so each point pip_i has degree did_i. Output any valid edge list.

Input

The first line contains TT. Each test case has nn (4n10004 \le n \le 1000) followed by nn lines with xix_i, yiy_i, and did_i.

Output

For each test case print n1n-1 edges as two indices per line. Any valid solution is accepted.