#include <bits/stdc++.h>
using namespace std;
template <typename T>
T abs(T a) {
  return a < 0 ? -a : a;
}
const int INF = (int)1e9;
const double PI = 3.1415926535897932384626433832795;
const int N = 111;
int n, a[N], m[N][N], u[N][N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    for (int j = 1; j <= a[i]; j++) scanf("%d", &m[i][j]);
    sort(m[i] + 1, m[i] + a[i] + 1);
  }
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    memset(u, 0, sizeof u);
    for (int j = 1; j <= a[i]; j++)
      for (int k = 1; k <= n; k++) {
        int ind = lower_bound(m[k] + 1, m[k] + 1 + a[k], m[i][j]) - m[k];
        if (m[k][ind] == m[i][j]) u[k][ind] = 1;
      }
    for (int j = 1; j <= n; j++) {
      int f = 0;
      for (int k = 1; k <= a[j]; k++)
        if (u[j][k]) f++;
      if (f == a[j]) cnt++;
    }
    puts(cnt == 1 ? "YES" : "NO");
  }
  return 0;
}
