#include <bits/stdc++.h>
using namespace std;
int Abs(int x) {
  if (x > 0)
    return x;
  else
    return x * (-1);
}
int Max(int x, int y) {
  if (x > y) return x;
  return y;
}
int main() {
  int n;
  cin >> n;
  vector<vector<int> > S(101);
  vector<int> sovp;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    for (int j = 0; j < t; j++) {
      int a;
      cin >> a;
      S[i].push_back(a);
    }
  }
  for (int i = 0; i < n; i++) {
    sovp.assign(n + 1, 0);
    for (int j = 0; j < S[i].size(); j++) {
      int boch = S[i][j];
      for (int k = 0; k < n; k++) {
        if (k != i)
          for (int g = 0; g < S[k].size(); g++) {
            if (S[k][g] == boch) sovp[k]++;
          }
      }
    }
    bool ok = true;
    for (int j = 0; j < n; j++) {
      if (sovp[j] == S[j].size() && j != i) {
        ok = false;
        break;
      }
    }
    if (ok)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
