|Author:||М. Спорышев||Time limit:||1 sec|
|Input file:||input.txt||Memory limit:||256 Mb|
Sorted array of integers is represented implicitly. Instead of each element, a set of that element and its neighbors on the right and on the left is known. First and last array elements have no more than one neighbor. Note that the set does not represent neither the order of elements nor duplicate values.
Your program must output explicit representation of the array (all elements in order).
First line of input file contains integer N — number of elements in array.
Following N lines contain implicit representation of array elements: set size si and si different integers aij — a set of i-th array element and its neighbors.
Output file must contain N integers — elements of original sorted array.
1 ≤ N ≤ 105
−109 ≤ aij ≤ 109
|No.||Input file (
||Output file (|