#include <bits/stdc++.h>
using namespace std;
void solve() {
  int h[100000];
  int n;
  int a;
  int m;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    while (a--) {
      cin >> m;
      h[m]++;
      if (h[m] == n) {
        cout << m << " ";
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
