#include <bits/stdc++.h>
using namespace std;
long long aa[505];
long long root(long long x) {
  while (aa[x] != x) {
    x = aa[aa[x]];
  }
  return x;
}
void union1(long long x, long long y) {
  long long a = root(x);
  long long b = root(y);
  aa[a] = b;
}
bool find(long long x, long long y) {
  long long a = root(x);
  long long b = root(y);
  return a == b;
}
int main() {
  long long n;
  cin >> n;
  long long n1 = n;
  set<long long> s[n];
  for (long long i = 0; i < n; i++) {
    long long t;
    cin >> t;
    for (long long j = 0; j < t; j++) {
      long long temp;
      cin >> temp;
      s[i].insert(temp);
    }
  }
  set<long long> a;
  set<long long>::iterator it1;
  for (it1 = s[0].begin(); it1 != s[0].end(); it1++) {
    a.insert(*it1);
  }
  for (long long i = 1; i < n; i++) {
    set<long long>::iterator it, it2;
    set<long long> temp;
    for (it = a.begin(); it != a.end(); it++) {
      if (s[i].count((*it))) {
        temp.insert((*it));
      }
    }
    a.clear();
    for (it2 = temp.begin(); it2 != temp.end(); it2++) {
      a.insert(*it2);
    }
  }
  set<long long>::iterator it;
  for (it = a.begin(); it != a.end(); it++) {
    cout << (*it) << " ";
  }
}
