#include <bits/stdc++.h>
using namespace std;
bool a[101][101];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int size;
    cin >> size;
    for (int j = 0; j < size; j++) {
      int temp;
      cin >> temp;
      a[i][temp] = true;
    }
  }
  for (int i = 1; i <= 100; i++) {
    bool flag = true;
    for (int j = 1; j <= n; j++) flag = flag & a[j][i];
    if (flag) cout << i << " ";
  }
}
