#include #define rep(i,n) for(int i = 0; i < (n); ++i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) using namespace std; typedef long long int ll; typedef pair P; #define yn {puts("Yes");}else{puts("No");} #define MAX_N 200005 int main() { int n; cin >> n; int a[n][100]; rep(i,n){ rep(j,100){ a[i][j] = -1; } } rep(i,n){ int p; cin >> p; rep(j,p){ cin >> a[i][j]; } } int cnt = 0; rep(j,100){ rep(i,n){ if(a[i][j] != -1){ if(cnt == 0){ cout << a[i][j]; cnt++; }else{ cout << ' ' << a[i][j]; } } } } cout << endl; return 0; }