s[25][6],n,i;main(){for(;~scanf("%s",s[n])?++n:!strcmp(s[i],s[++i+n/2]););printf("%d\n%s\n%s",i,s[i],s[i+n/2]);}