#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> s1;
  int r;
  cin >> r;
  for (int i = 0; i < r; i++) {
    int x;
    cin >> x;
    s1.insert(x);
  }
  n--;
  set<int> s2;
  while (n--) {
    s2.clear();
    cin >> r;
    for (int i = 0; i < r; i++) {
      int x;
      cin >> x;
      if (s1.find(x) != s1.end()) {
        s2.insert(x);
      }
    }
    s1 = s2;
  }
  for (set<int>::iterator it = s1.begin(); it != s1.end(); it++) {
    cout << (*it) << " ";
  }
  cout << endl;
}
