#include <bits/stdc++.h>
using namespace std;
int main() {
  FILE *fp, *fo;
  fp = fopen("input.txt", "r");
  fo = fopen("output.txt", "w");
  int n, m, a[102][102] = {0}, b[102] = {0}, i, j;
  set<int> v[102], t[102];
  set<int>::iterator it;
  vector<int> vv;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> m;
    b[i] = m;
    for (j = 0; j < m; j++) {
      cin >> a[i][j];
      v[a[i][j]].insert(i);
    }
  }
  int temp, k;
  for (i = 0; i < n; i++) {
    vv.clear();
    m = b[i];
    for (j = 0; j < m; j++) {
      temp = a[i][j];
      for (it = v[temp].begin(); it != v[temp].end(); it++) {
        b[(*it)]--;
        vv.push_back((*it));
      }
    }
    int count = 0;
    for (k = 0; k < n; k++) {
      if (b[k] == 0) count++;
    }
    if (count > 1)
      printf("NO\n");
    else
      printf("YES\n");
    for (k = 0; k < vv.size(); k++) b[vv[k]]++;
  }
  return 0;
}
