#include "bits/stdc++.h" #define rep(i,n) for(int i=0;i> N; vector P(N); vector> A(N, vector(100)); rep(i, N) { cin >> P[i]; rep(j, P[i]) { cin >> A[i][j]; } } rep(i, 100) { rep(j, N) { if (i >= P[j]) continue; cout << A[j][i] << " "; } } cout << endl; }