#include <bits/stdc++.h>
time_t waktu = clock();
void gettime() {
  printf("\nTime : %.2lf", (clock() - waktu) / double(CLOCKS_PER_SEC));
}
bool comp(int a, int b) { return (a > b); }
using namespace std;
int main() {
  int data[105][105] = {}, n, i, j, k, cek[105], hasil;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &data[i][0]);
    for (j = 1; j <= data[i][0]; j++) {
      scanf("%d", &data[i][j]);
    }
    sort(data[i] + 1, data[i] + 1 + data[i][0]);
  }
  for (i = 1; i <= n; i++) {
    hasil = 1;
    for (j = 1; j <= n; j++) {
      cek[j] = 1;
    }
    for (j = 1; j <= data[i][0]; j++) {
      for (k = 1; k <= n; k++) {
        if (k != i) {
          if (data[k][cek[k]] == data[i][j]) {
            cek[k]++;
            if (cek[k] > data[k][0]) {
              hasil = 0;
              break;
            }
          }
        }
      }
      if (hasil == 0) break;
    }
    if (hasil == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
