Alice and Bob play a puzzle. Alice draws a convex polygon with $n$ vertices and labels the vertices with the integers $1, 2, \dots, n$ in an arbitrary order. She then draws some diagonals so that no two of them cross (sharing an endpoint is not considered a crossing).
Alice lists, in a single mixed collection, every side of the polygon together with the diagonals she drew, each described only by its two endpoints. She does not reveal which pairs are sides and which are diagonals. From this list alone Bob must recover the cyclic order of the vertices around the border of the polygon.
Because the polygon is convex and the diagonals never cross, the border order is uniquely determined up to rotation and reflection. Write a program that, for each puzzle, reconstructs that border order.
The first line contains one integer $d$, the number of puzzles ($1 \le d \le 20$).
Each puzzle is given on two lines.
The sides and diagonals appear in an arbitrary order and there are no duplicates. Every puzzle is guaranteed to have a solution.
Print exactly $d$ lines, one per puzzle. For the $i$-th puzzle, print a permutation of $1, 2, \dots, n$: the vertices in the order they appear around the border of the polygon. The sequence must start at vertex $1$, and its second element must be the smaller of the two border neighbours of vertex $1$.