#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, r, t;
  bool first = true;
  map<int, bool> train, tt;
  train.clear();
  cin >> n;
  while (n--) {
    cin >> r;
    tt.clear();
    while (r--) {
      cin >> t;
      tt[t] = true;
      if (first) train[t] = true;
    }
    if (first)
      first = false;
    else
      for (auto &i : train)
        if (i.second && !tt[i.first]) train[i.first] = false;
  }
  first = true;
  for (auto &i : train) {
    if (!i.second) continue;
    if (!first) cout << ' ';
    cout << i.first;
    first = false;
  }
  cout << "\n";
  return 0;
}
