#include <bits/stdc++.h>
using namespace std;
int freq[105];
int main() {
  int n;
  int r;
  int ar[105][105];
  cin >> n;
  int mn = INT_MAX;
  int midx;
  for (int i = 0; i < n; i++) {
    cin >> r;
    for (int j = 0; j < r; j++) {
      cin >> ar[i][j];
      freq[ar[i][j]]++;
    }
    if (r < mn) {
      mn = r;
      midx = i;
    }
  }
  for (int i = 0; i < mn; i++) {
    if (freq[ar[midx][i]] == n) {
      if (i) cout << " ";
      cout << ar[midx][i];
    }
  }
  return 0;
}
