#include <bits/stdc++.h>
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
const long double eps = 1e-9;
const long double pi = 3.14159265358979323846;
using namespace std;
int states[105][105];
int main() {
  memset(states, 0, sizeof(states));
  int pn;
  cin >> pn;
  for (int i = (0), _end = (pn); i < _end; ++i) {
    cin >> states[i][0];
    int tmp;
    for (int j = (0), _end = (states[i][0]); j < _end; ++j) {
      cin >> tmp;
      states[i][tmp]++;
    }
  }
  for (int i = (0), _end = (pn); i < _end; ++i) {
    string ans = "YES";
    int ok = 0;
    for (int j = (0), _end = (pn); j < _end; ++j)
      if (i != j) {
        if (states[j][0] <= states[i][0]) {
          ok = 1;
          for (int k = (1), _end = (101); k < _end; ++k) {
            if (states[j][k] == 1) {
              if (states[i][k] == 0) {
                ok = 0;
                break;
              }
            }
          }
          if (ok) break;
        }
      }
    if (ok) ans = "NO";
    cout << ans << endl;
  }
  return 0;
}
