High Frequency

2

1 votes
Problem

You have been given a set N strings X1 , X2 , ... XN . Consider any non–empty string X (X need not belong to the given set of N strings). Suppose X occurs (as a substring) in k out of the N given strings belonging to the set. Your job is to choose X so as to maximize the value of k. If there are multiple solutions possible, choose the X so as to minimize its length. If multiple solutions are still possible, 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.

Ouput

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

Constraints

1 <= T <= 5
1 <= N <= 100
1 <= |Xi| <= 100, |Xi| denotes the length of the input words.

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?