#include <bits/stdc++.h>
using namespace std;
set<int> s[105];
vector<int> res;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, r, t, min = INT32_MAX, tmp;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> r;
    for (int j = 0; j < r; j++) {
      cin >> t;
      s[i].insert(t);
    }
    if (r < min) {
      min = r;
      tmp = i;
    }
  }
  for (auto it : s[tmp]) res.push_back(it);
  for (int j = 0; j < n; j++) {
    if (j == tmp) continue;
    for (int i = 0; i < min; i++) {
      if (s[j].find(res[i]) == s[j].end()) {
        res.erase(res.begin() + i);
        --min;
        --i;
      }
    }
  }
  for (int i = 0; i < min; i++) cout << res[i] << " ";
  return 0;
}
