#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  bool array[100];
  memset(array, 1, 100);
  while (n--) {
    int r, ai;
    cin >> r;
    bool b[100];
    memset(b, 0, 100);
    for (int i = 0; i < r; ++i) cin >> ai, b[ai - 1] = 1;
    for (int i = 0; i < 100; ++i)
      if (!b[i]) array[i] = 0;
  }
  for (int i = 0; i < 100; ++i)
    if (array[i]) cout << i + 1 << " ";
}
