#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, i, j, k, w, l, count, max = INT_MIN, min = INT_MAX;
  cin >> n;
  int a[105] = {0};
  for (i = 1; i <= n; i++) {
    cin >> w;
    for (j = 1; j <= w; j++) {
      cin >> count;
      a[count]++;
    }
  }
  for (i = 0; i < 105; i++) {
    if (a[i] >= n) {
      cout << i << " ";
    }
  }
  cout << "\n";
  return 0;
}
