#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fast();
  long long n;
  cin >> n;
  map<long long, long long> m;
  for (int i = 0; i < n; ++i) {
    long long r;
    cin >> r;
    for (int j = 0; j < r; ++j) {
      long long temp;
      cin >> temp;
      m[temp]++;
    }
  }
  for (auto it : m)
    if (it.second == n) cout << it.first << " ";
  cout << '\n';
}
