You have been given a set of N strings S1, S2, .... SN. Consider any non-empty string S (S need not belong to the given set of N strings). Suppose S occurs (as a substring) in K out of the N given strings in the set. Your job is to choose S such that the value of K is maximized. If there are many such strings, choose the one with the least length. If there are many such strings with the least length, choose the lexicographically smallest of them all.

Input:

The first line consists of T the number of test cases.
The first line in each test case consists of N, the number of words in the given set. Each of the next N lines contains a single word consisting of lowercase English alphabets (a-z) only.

Output:

Print the answer to each test case on a new line, the answer to each test case being a single string S as described in the problem above.

Constraints :

1 ≤ T ≤ 5

1 ≤ N ≤ 100

1 ≤ |Si| ≤ 100, |Si| denotes the length of the input words.

Author : Himanshu

Tester : Shreyans

(By IIT Kgp HackerEarth Programming Club)

SAMPLE INPUT
1
1
shades

SAMPLE OUTPUT
a
'''import operator


m = input()
for i in range(m):
	h = {}
	n = int(raw_input())
	for i in range(n):
		s = raw_input()
		for i in range(len(s)):
			for j in range(i,len(s)):
				sub = s[i:j+1]
				print sub
				if sub in h:
					h[sub]+=1
				else:
					h[sub]=1
	sorted_x = sorted(h.items(), key=operator.itemgetter(1),reverse=True)
#	k = sorted_x[0][-1]
#	l = []
	print sorted_x
	for i in sorted_x:
		if i[-1] == k:
			l.append(i[0])
		else:
			break
	print l[0]'''
import operator


m = input()
for i in range(m):
	h1 = {'a':0,'b':0,'c':0,'d':0,'e':0,'f':0,'g':0,'h':0,'i':0,
		'j':0,'k':0,'l':0,'m':0,'n':0,'o':0,'p':0,'q':0,'r':0,'s':0,
		't':0,'u':0,'v':0,'w':0,'x':0,'y':0,'z':0}
	h2 = {'a':0,'b':0,'c':0,'d':0,'e':0,'f':0,'g':0,'h':0,'i':0,
		'j':0,'k':0,'l':0,'m':0,'n':0,'o':0,'p':0,'q':0,'r':0,'s':0,
		't':0,'u':0,'v':0,'w':0,'x':0,'y':0,'z':0}
	n = int(raw_input())
	for i in range(n):
		s = raw_input()
		for k in s:
			h1[k] +=1
	#	print h1
	#	print "h2: ini",h2
		for k in h1:
			if h1[k]>0:
				h2[k]+=1
	#	print h2
		for k in s:
			h1[k] =0
	sorted_x = sorted(h2.items(), key=operator.itemgetter(1),reverse=True)
	k = sorted_x[0][-1]
	l = []
#	print sorted_x
	for i in sorted_x:
		if i[-1] == k:
			l.append(i[0])
		else:
			break
	l.sort()
	print l[0]