Lately, a national version of a bingo game has become very popular in Berland. There are n players playing the game, each player has a card with numbers. The numbers on each card are distinct, but distinct cards can have equal numbers. The card of the i-th player contains m_{i} numbers.

During the game the host takes numbered balls one by one from a bag. He reads the number aloud in a high and clear voice and then puts the ball away. All participants cross out the number if it occurs on their cards. The person who crosses out all numbers from his card first, wins. If multiple people cross out all numbers from their cards at the same time, there are no winners in the game. At the beginning of the game the bag contains 100 balls numbered 1 through 100, the numbers of all balls are distinct.

You are given the cards for each player. Write a program that determines whether a player can win the game at the most favorable for him scenario or not.


-----Input-----

The first line of the input contains integer n (1 ≤ n ≤ 100) — the number of the players. Then follow n lines, each line describes a player's card. The line that describes a card starts from integer m_{i} (1 ≤ m_{i} ≤ 100) that shows how many numbers the i-th player's card has. Then follows a sequence of integers a_{i}, 1, a_{i}, 2, ..., a_{i}, m_{i} (1 ≤ a_{i}, k ≤ 100) — the numbers on the i-th player's card. The numbers in the lines are separated by single spaces.

It is guaranteed that all the numbers on each card are distinct.


-----Output-----

Print n lines, the i-th line must contain word "YES" (without the quotes), if the i-th player can win, and "NO" (without the quotes) otherwise.


-----Examples-----
Input
3
1 1
3 2 4 1
2 10 11

Output
YES
NO
YES

Input
2
1 1
1 1

Output
NO
NO

Difficulty: EASY

Solutions:
def contiene(l, s, n, m):
	j = 0
	for i in range(n):
		x = l[i]
		while j < m and (not l[i] == s[j]):
			j += 1
		if j == m and (not i == n):
			return False
	return True
n = int(input())
l = []
m = []
for i in range(n):
	s = [int(x) for x in input().split()]
	m.append(s[0])
	l.append(s[1:])
	l[i].sort()
for i in range(n):
	canWin = True
	for j in range(n):
		if not j == i:
			if m[i] < m[j]:
				continue
			if contiene(l[j], l[i], m[j], m[i]):
				canWin = False
				break
	if canWin:
		print('YES')
	else:
		print('NO')


n = int(input())
a = [set(list(map(int, input().split()))[1:]) for _ in range(n)]
res = 0
print(*['YES' if sum((i.issubset(j) for i in a)) == 1 else 'NO' for j in a], sep='\n')


n = int(input())
(t, l, s) = ([0] * n, [0] * n, ['YES'] * n)
for i in range(n):
	p = tuple(map(int, input().split()))
	(t[i], l[i]) = (set(p[1:]), p[0])
for i in range(n):
	for j in range(i + 1, n):
		if l[i] < l[j]:
			if all((k in t[j] for k in t[i])):
				s[j] = 'NO'
		elif all((k in t[i] for k in t[j])):
			if l[i] == l[j]:
				s[j] = 'NO'
			s[i] = 'NO'
print('\n'.join(s))


n = int(input())
cards = [[set(map(int, input().split()[1:])), i, True] for i in range(n)]
cards.sort(key=lambda x: len(x[0]))
for i in range(n - 1, -1, -1):
	if not cards[i][2]:
		continue
	for j in range(0, i):
		if cards[j][0] == cards[i][0]:
			cards[j][2] = cards[i][2] = False
			break
		if cards[j][0] < cards[i][0]:
			cards[i][2] = False
			break
cards.sort(key=lambda x: x[1])
for card in cards:
	print('YES' if card[2] else 'NO')


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
wr = stdout.write
rd = lambda : stdin.readline().strip()
all = []
n = int(rd())
for _ in range(n):
	all.append(set(map(int, rd().split()[1:])))
out = [True] * n
for i in range(n):
	for j in range(n):
		if i != j and all[i] <= all[j]:
			out[j] = False
for i in range(n):
	print('YES' if out[i] == True else 'NO')


n = int(input())
cards = [None] + [[] for i in range(n)]
for i in range(1, n + 1):
	cards[i] = list(map(int, input().split()))[1:]
ans = [None] + [True for i in range(n)]
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if i == j:
			continue
		if set(cards[i]) & set(cards[j]) == set(cards[j]):
			ans[i] = False
o = ''
for i in range(1, len(ans)):
	if ans[i] == True:
		o += 'YES\n'
	elif ans[i] == False:
		o += 'NO\n'
print(o)


from sys import stdin, stdout
from collections import Counter

def ai():
	return list(map(int, input().split()))

def ei():
	return map(int, input().split())

def ip():
	return int(stdin.readline())

def op(ans):
	return stdout.write(str(ans) + '\n')
n = ip()
a = []
for i in range(n):
	a.append(set(ai()[1:]))
for i in range(n):
	flag = 0
	for j in range(n):
		if i == j:
			continue
		elif a[j].issubset(a[i]):
			flag = 1
			break
	print('YES' if not flag else 'NO')


n = int(input())
p = list()
for i in range(n):
	p.append(set([int(x) for x in input().split()[1:]]))
for i in range(n):
	for j in range(n):
		if i != j:
			if p[i].issuperset(p[j]):
				print('NO')
				break
	else:
		print('YES')


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
t = ii()
l = []
for i in range(t):
	(x, *y) = f()
	l.append(set(y))
for i in range(t):
	fg = 0
	for j in range(t):
		if i != j and len(l[i]) >= len(l[j]):
			if all((x in l[i] for x in l[j])):
				fg = 1
	print('YNEOS'[fg == 1::2])


n = int(input())
c = [[int(s) for s in input().split()][1:] for x in range(n)]
for i in range(n):
	for j in range(n):
		if i != j:
			for k in c[j]:
				if k not in c[i]:
					break
			else:
				print('NO')
				break
	else:
		print('YES')


n = int(input())
matrix = [[0 for x in range(101)] for y in range(n)]
for i in range(n):
	m = list(map(int, input().split(' ')))
	for j in range(1, len(m)):
		matrix[i][m[j] - 1] = 1
for i in range(n):
	ans = 'YES'
	for j in range(n):
		if i == j:
			continue
		for k in range(101):
			if matrix[i][k] == 0 and matrix[j][k] == 1:
				break
		if k == len(matrix[0]) - 1:
			ans = 'NO'
	print(ans)


def subset(s1, s2):
	d = {}
	for i in s1:
		d[i] = 1
	flag = 0
	for i in s2:
		if i not in d:
			flag = 1
			break
	if flag == 0:
		return True
	else:
		return False
n = int(input())
l = []
for i in range(n):
	l.append(list(map(int, input().split()))[1:])
for i in range(n):
	ans = 'YES'
	for j in range(n):
		if i != j:
			if subset(l[i], l[j]):
				ans = 'NO'
				break
	print(ans)