#include #include char line[251]; char jmena[26][65]; int cesty[26]; void init(void) { for(int i = 0; i < 26; i++) { cesty[i] = 0; } } int main() { int i,r,s,c; char name[65]; init(); scanf("%d %d %d\n", &r, &s, &c); while((r!=0)&&(s!=0)&&(c!=0)) { for(i = 0; i < c; i++) { scanf("%s\n", jmena[i]); } for(int j = 0; j < r; j++) { scanf("%s\n", line); for(int k = 0; k < s; k++) if (line[k] != '*') cesty[line[k]-'A'] += 1; } int max = 0, index = 0; for(i = 0; i < 26; i++) if (cesty[i] > max) { max = cesty[i]; index = i; } for(i = 0; i < c; i++) if (jmena[i][0] == index + 'A') strcpy(name, jmena[i]); printf("Nejzravejsi cervotoc je %s.\n", name); init(); scanf("%d %d %d\n", &r, &s, &c); } return 0; }