#include <bits/stdc++.h>
using namespace std;
int n, m, d, t, a[101];
int main() {
  cin >> n;
  d = n;
  while (n--) {
    for (cin >> m; m--;) {
      cin >> t;
      a[t]++;
      if (a[t] == d) cout << t << " ";
    }
  }
}
