#include <bits/stdc++.h>
using namespace std;
bool vis[105][105];
int main() {
  int n;
  scanf("%d", &n);
  int m;
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    vis[1][x] = true;
  }
  for (int i = 2; i <= n; i++) {
    int m;
    scanf("%d", &m);
    for (int j = 1; j <= m; j++) {
      int x;
      scanf("%d", &x);
      if (vis[i - 1][x]) vis[i][x] = true;
    }
  }
  for (int i = 1; i <= 100; i++)
    if (vis[n][i]) printf("%d ", i);
  return 0;
}
