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.
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.
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.
1 <= T <= 5
1 <= N <= 100
1 <= |Xi| <= 100, |Xi| denotes the length of the input words.