#include<stdio.h>
#include<string.h>
#include<algorithm>

using namespace std;

FILE *fin,*fout;


int ml,l,i,b,n,j;
char r[5000][51],t[51],p[51];

int main()
{
 fin=fopen("igra.in","r");
 fout=fopen("igra.out","w");
 fscanf(fin,"%d",&n); 
 fscanf(fin,"%s",&r[i]);
 printf("1\n"); 
 for(i=0;i<n;i++)
 {
  fscanf(fin,"%s",&r[i]);
  fprintf(fout,"%s",r[i]); 
 }
 printf("1\n"); 
 sort(r,r+n);
printf("1\n");  
 for(i=0;i<n;i++)
 {
  printf("1\n"); 
  l=strlen(r[50]);
  printf("%d",l); 
  if(ml<l)
  {
          printf("1\n"); 
   ml=l;
   for(j=0;j<50;j++)
   t[j]=r[j][i];
  }
 }
printf("1\n");  
 if(ml%2!=1)
  fprintf(fout,"1\n");
 else
  fprintf(fout,"1\n");
 fprintf(fout,"%s",t);  
 return 0;
}
