#include <bits/stdc++.h>
using namespace std;
int n;
int m[105];
list<int> a[105];
list<int> b[105];
int main() {
  int i, j, t, u, v, r, k;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> m[i];
    for (j = 1; j <= m[i]; j++) {
      cin >> u;
      a[i].push_back(u);
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) b[j] = a[j];
    j = 0;
    k = 0;
    for (list<int>::iterator it = b[i].begin(); it != b[i].end(); it++) {
      t = *it;
      for (r = 1; r <= n; r++)
        if (r != i) {
          b[r].remove(t);
          if (b[r].size() == 0) {
            k++;
            break;
          }
        }
      if (k >= 1) {
        break;
      }
      j++;
    }
    if (k == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
