#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
int dX[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dY[] = {-1, -1, 0, 1, 1, 1, 0, -1};
int n, m[128], a[128][128], f[128];
int main(void) {
  scanf("%d", &n);
  for (int((i)) = (0); ((i)) < ((n)); ((i))++) {
    scanf("%d", m + i);
    for (int((j)) = (0); ((j)) < ((m[i])); ((j))++) scanf("%d", &a[i][j]);
  }
  for (int((i)) = (0); ((i)) < ((n)); ((i))++) {
    memset(((f)), (0), sizeof(((f))));
    for (int((j)) = (0); ((j)) < ((m[i])); ((j))++) f[a[i][j]] = 1;
    int ok = 1;
    for (int((j)) = (0); ((j)) < ((n)); ((j))++)
      if (i != j) {
        int pode = 0;
        for (int((k)) = (0); ((k)) < ((m[j])); ((k))++)
          if (!f[a[j][k]]) {
            pode = 1;
            break;
          }
        if (!pode) {
          ok = 0;
          break;
        }
      }
    printf("%s\n", ok ? "YES" : "NO");
  }
  return 0;
}
