program cerv;
 var x,y,n,i,j:integer;
     cervi:array['A'..'Z'] of longint;
     mena:array['A'..'Z'] of string[255];
     c,maxc:char;
   pom:string[255];

begin
 readln(y,x,n);
 while (n<>0) do
 begin
   for c:='A' to 'Z' do cervi[c]:=-1;
   for i:=1 to n do begin readln(pom); mena[pom[1]]:=pom;
     cervi[pom[1]]:=0; end;
   for i:=1 to y do
   begin
    for j:=1 to x do
    begin
      read(c);
      if c<>'*' then Inc(cervi[c]);
    end;
    readln;
   end; 
  { write(cervi['A'],' ',cervi['B']);}
   maxc:='A';
   for c:='B' to 'Z' do if cervi[c]>cervi[maxc] then maxc:=c;
   writeln('Nejzravejsi cervotoc je ',mena[maxc],'.');
   readln(y,x,n);
 
end; 
  end.
