The state space of the output of this problem (and as a matter of fact, all the problems in this Cook-Off) is - 2 to the power T -
where T is the number of test cases (so be extra careful!). Each test case consists of T lines consisting of "YES" or "NO".
If a test case accurately represents the output that you would print for this file,
then print "YES" for this case. Print "NO" otherwise.


The output for a file is defined as the output for all the test cases one by one. If you output "YES" for test case 'x', then your output
must match the input for the test case 'x', and if and only if your output does not match the input for test case 'x', should you print "NO"
for that case.


Input

The first Line contains a single number T, the number of test cases.


Each test case contains T lines. Each line is either "YES" or "NO". The T lines together represent the candidate output for this problem.


Output

If the candidate-output (that you got in the input) is what you are going to print then print "YES", and
only if it is different, print "NO". The output for each case must be on a single line by itself.


Constraints

1 ≤ T ≤ 100
There is only one unique valid output that you can print


Sample Input

2
NO
NO
NO
YES


Sample Output

NO
YES


Explanation

Your output clearly matches the input for the second case. No other output can be valid for this file.
t=int(raw_input())
b=[]
l=[]
d=0
for i in xrange(0,t*t):
	k=raw_input()
	if(k[0]=='Y'):
		d='1'	
	elif(k[0]=='N'):
		d='0'
	l.append(d)
	if(i%t==t-1):
		b.append(''.join(l))
		l=[]

#print b
ans=0
for i in xrange(0,t):
	f=1
	for j in xrange(0,t):
		if((b[i]==b[j] and b[i][j]=='0') or (b[i]!=b[j] and b[i][j]=='1')):
			f=0
			break
#		print f
	if(f==1):
		ans=b[i]
		break;

#print ans
if(ans!=0):
	for i in ans:
		if(i=='1'):
			print 'YES'
		else:
			print 'NO'
else:
	for i in xrange(0,t):
		print 'NO'