#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
int cubeta[MAXN + 2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int r;
    cin >> r;
    for (int kk = 0; kk < r; ++kk) {
      int val;
      cin >> val;
      cubeta[val]++;
    }
  }
  for (int i = 0; i < MAXN; ++i) {
    if (cubeta[i] == n) {
      cout << i << " ";
    }
  }
  cout << '\n';
  return 0;
}
