#include <bits/stdc++.h>
using namespace std;
set<int> arr[120];
int cnt[120];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> cnt[i];
    for (int i1 = 0; i1 < cnt[i]; ++i1) {
      int t;
      cin >> t;
      arr[i].insert(t);
    }
  }
  for (int i = 0; i < n; ++i) {
    string ans = "YES";
    for (int i1 = 0; i1 < n; ++i1) {
      cnt[i1] = arr[i1].size();
    }
    for (set<int>::iterator it = arr[i].begin(); it != arr[i].end(); it++) {
      if (ans == "NO") break;
      int num = *it;
      for (int i1 = 0; i1 < n; ++i1) {
        if (i == i1) continue;
        if (arr[i1].find(num) != arr[i1].end()) cnt[i1] -= 1;
        if (cnt[i1] == 0) {
          ans = "NO";
          break;
        }
      }
    }
    cout << ans << "\n";
  }
}
