G. The Missing Bone
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Archie, the rising star of the renowned Archer family of archaeologists, is conducting his first major excavation. He had all the pieces required for an Archaeopteryx fossil, but before he could assemble the skeleton, his dog took one of the bones, disrupting Archie's carefully planned layout.

The original layout for the skeleton was in the form of $$$n$$$ lines, where the $$$i^{\text{th}}$$$ line contained the indexes of the bones that were adjacent to bone $$$i$$$. Adjacency was undirected, so if the $$$i^{\text{th}}$$$ line contained $$$j$$$, then the $$$j^{\text{th}}$$$ line contained $$$i$$$. Every bone in the original layout was adjacent to at least one other bone. However, one of the bones was taken, removing its corresponding line, so there are now $$$n-1$$$ lines, and all lines after the line representing the stolen bone are shifted down by one.

Please help Archie determine the index of the earliest bone that could have been stolen and its adjacent bones.

Input

The first line of input contains $$$n$$$ ($$$2 \le n \le 2 \cdot 10^3$$$), the number of lines in the original layout.

The next $$$n-1$$$ lines start with an integer $$$m$$$ ($$$1 \le m \lt n$$$), followed by $$$m$$$ distinct integers $$$b_i$$$ ($$$1 \le b_i \le n$$$), the adjacent bones to bone $$$x$$$ ($$$b_i \ne x$$$), where $$$x$$$ was the index of the line in the original layout.

Output

The output should be one line containing the earliest possible index of the stolen bone, followed by its adjacent bones in ascending order.

Example
Input
3
2 2 3
2 1 2
Output
2 1 3
Note

In this case, the only possible index of the stolen bone is bone $$$2$$$, and it was previously adjacent to bones $$$1$$$ and $$$3$$$.