#include <bits/stdc++.h>
std::vector<std::bitset<100> > players;
bool all_is_well(std::vector<std::bitset<100> >::iterator it) {
  for (std::vector<std::bitset<100> >::iterator ite = players.begin();
       ite != players.end(); ++ite) {
    if (it != ite && (~*it & *ite).none()) return false;
  }
  return true;
}
int main() {
  int nplayer;
  std::cin >> nplayer;
  players.resize(nplayer);
  for (int i = 0; i < nplayer; i++) {
    int ncard;
    std::cin >> ncard;
    while (ncard--) {
      int card;
      std::cin >> card;
      players[i][card - 1] = true;
    }
  }
  for (std::vector<std::bitset<100> >::iterator it = players.begin();
       it != players.end(); ++it) {
    std::cout << (all_is_well(it) ? "YES" : "NO") << std::endl;
  }
}
