#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    int r;
    cin >> r;
    while (r--) {
      int var;
      cin >> var;
      mp[var]++;
    }
  }
  for (auto it : mp)
    if (it.second == n) cout << it.first << " ";
  cin >> n;
}
