#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[101] = {0};
  int m, num;
  int Mx = 0;
  for (int i = 0; i < n; i++) {
    cin >> m;
    for (int j = 0; j < m; j++) {
      cin >> num;
      Mx = max(Mx, num);
      a[num]++;
    }
  }
  for (int i = 1; i <= Mx; i++) {
    if (a[i] == n) {
      cout << i << " ";
    }
  }
  return 0;
}
