#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:5000000000")
const long long mod = 1000000007;
long long Inf = (long long)2e9;
long long LINF = (long long)1e18 + 1e17;
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  map<int, int> cnt;
  int n;
  cin >> n;
  int N = n;
  while (n--) {
    int k;
    cin >> k;
    for (int(i) = 0; (i) < k; (i)++) {
      int x;
      cin >> x;
      cnt[x]++;
    }
  }
  for (auto it = cnt.begin(); it != cnt.end(); it++) {
    if (it->second == N) cout << it->first << " ";
  }
  return 0;
}
