#include <bits/stdc++.h>
using namespace std;
int v[102][102];
int m[103];
int c[103];
bool okk[102][102];
int main() {
  bool ok = false;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m[i];
    for (int j = 0; j < m[i]; j++) {
      cin >> v[i][j];
      okk[i][v[i][j]] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (m[i] >= m[j] && i != j) {
        for (int q = 0; q < m[j]; q++) {
          if (okk[i][v[j][q]]) {
            c[j]++;
          } else {
            break;
          }
        }
      }
    }
    for (int w = 0; w < n; w++) {
      if (c[w] == m[w] && c[w] != 0) {
        ok = true;
        break;
      }
    }
    if (ok == true) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
    memset(c, 0, sizeof(c));
    ok = false;
  }
  return 0;
}
