import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N = int(readline()) A = np.zeros((N, 110), np.int32) for i in range(N): p, *a = map(int, readline().split()) A[i,:p] = a A = A.T.ravel() answer = A[A > 0] print(' '.join(answer.astype(str)))