#include <bits/stdc++.h>
using namespace std;
int arr[107];
int main() {
  int n, t, x, d;
  cin >> n;
  d = n;
  while (n--) {
    cin >> x;
    while (x--) {
      cin >> t;
      arr[t]++;
      if (arr[t] == d) {
        cout << t << " ";
      }
    }
  }
  return 0;
}
