#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
char str[20][65];
char st[65];
char s[65];
int n,t;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
int i,j,k,l;
getchar();
bool flag = false;
int ans = 0;
for( i = 0; i<n; i++)
gets(str[i]);
int len = strlen(str[0]);
for( i = 0; i<len; i++)
{
for( k = i ; k < len; k++)
{
int num = 0;
//枚举子串
for( j = i; j <= k; j++)
st[num++] = str[0][j];
st[num] = '\0';
for( l = 1; l < n; l++)
if(strstr(str[l],st) == 0) break;//在2~n的字符串内寻找st,未找到则返回NULL(0)
if(ans < num && l == n)
{
ans = num;
strcpy(s,st);
}
else if(ans == num && l == n)
{
if(strcmp(s,st) > 0)
strcpy(s,st);
}
}
}
if(ans < 3)
cout<<"no significant commonalities"<<endl;
else
cout<<s<<endl;
}
}