intmain(){ char s[3][256][256]; memset(s, 0, sizeof(s)); int i = 0, j = 0, k = 0;
for (char c; ~(c = getchar()); ) { if (c == '\n') { ++i; j = 0; k = 0; } elseif (c == ' ') { ++j; k = 0; } else { s[i][j][k++] = c; } }
int max = 0; for (int i = 0; s[0][i][0]; ++i) { for (int j = 0; s[1][j][0]; ++j) { for (int k = 0; s[2][k][0]; ++k) { if (!strcmp(s[0][i], s[1][j]) && !strcmp(s[0][i], s[2][k])) { printf("%s ", s[0][i]); max = strlen(s[0][i]); } } } }
if (max) { printf("%d", max); } else { printf("NULL"); }