program cervotoc (input,output);

const
  maxc=26;
  
var r,s,c:word;
  name:array[1..maxc] of string[250];
  poc:array['A'..'Z'] of integer;
  line:string[255];
  ch:char;
  i,j,maxzrav,maxcerv:integer;
begin

for ch:='A' to 'Z' do poc[ch]:=0;
for i:=1 to maxc do name[i]:=' ';

readln (r,s,c);

while (r<>0) and (s<>0) and (c<>0) do
begin
  for i:=1 to c do
    readln(name[i]);
  for i:=1 to r do
  begin
    readln (line);
    for j:=1 to s do
      if line[j]<>'*'
        then inc(poc[line[j]]);
  end;

  maxcerv:=0;
  maxzrav:=0;
  
  for i:=1 to c do  
  begin
{    writeln (i,' ',name[i],' ',poc[name[i][1]]);    }
    if maxzrav<poc[name[i][1]]
    then begin 
      maxzrav:=poc[name[i][1]];
      maxcerv:=i;
    end;
  end;

  writeln ('Nejzravejsi cervotoc je '+name[maxcerv]+'.');
        
  readln (r,s,c); 
end;  


end.
