#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, b[100], k, z = 0;
  cin >> n;
  cin >> m;
  k = m;
  int a[k];
  n--;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
  }
  while (n--) {
    cin >> m;
    for (int i = 0; i < m; i++) {
      cin >> b[i];
    }
    for (int i = 0; i < k; i++) {
      if (a[i] != 0) {
        for (int j = 0; j < m; j++) {
          if (a[i] == b[j]) {
            z = 1;
            break;
          }
        }
        if (z == 1) {
          z = 0;
          continue;
        } else
          a[i] = 0;
      }
    }
  }
  sort(a, a + k);
  for (int i = 0; i < k; i++) {
    if (a[i] != 0) cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}
