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

using namespace std;

FILE *fin,*fout;


int ml,l,i,b,n;
char *r[5000],*t;

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