#include
#include
void main()
{
int cas;
while(scanf("%d",&cas)!=EOF && cas)
{
char str[1000][15];
int i,j,max=0;
int k=0;
int count[1000]={0};
count[0] = 1;
getchar();
for(i=0;i
#include
#include
void main()
{
int cas;
while(scanf("%d",&cas)!=EOF && cas)
{
char str[1000][15];
int i,j,max=0;
int k=0;
int count[1000]={0};
count[0] = 1;
getchar();
for(i=0;i