n = int(input()) lis = [[] for i in range(105)] for i in range(n): l = list(map(int,input().split())) for j,a in enumerate(l[1:]): lis[j].append(a) ans = [] for l in lis: for a in l: ans.append(a) print(*ans)