#include #include int main(void) { int N,j,i; scanf("%d",&N); char a[N][20],b[N][20]; for (i = 0; i < N; i++) { scanf("%s",a[i]); } for (i = 0; i < N; i++) { scanf("%s",b[i]); } for (i = 0; i < N; i++) { for (j = 0; j < strlen(a[0]); j++) { if (a[i][j] != b[i][j]) { break; } } if (a[i][j] != b[i][j]) { break; } } printf("%d\n%s\n%s\n",i + 1,a[i],b[i]); return 0; }