{Se auto to progamma dineis onomata (psifous) kai bgazei auton pou}
{pou sygkentronei panv apo 50%}
{Sthn askhsh yparxei desmeush oste na xrhsimopoieithoun}
{ena srting winner , enas metrhths counter , kai dyo listes head,temp}
program xpistos (input,output);
type link=^node;
node=record
data : string[33];
next : link
end;

procedure reading (var temp,head:link);
var winner:string[33];
begin
writeln('ƒ—‘’„ ’†Œ –†”Ž ‘€‘ ’„ŠŽ‘ ‹„ [t]');
winner:='';
head:=nil;
while winner<>'t' do
begin
readln(winner);
if winner<>'t' then
begin
new(temp);
temp^.data:=winner;
temp^.next:=head;
head:=temp;
end
end
end;
var temp,head:link;
counter:integer;
winner:string[33];
begin
reading(temp,head);
counter:=-1;
while temp<>nil do
begin
if counter=-1 then begin winner:=temp^.data; counter:=counter+1 end;
if winner<>temp^.data then counter:=counter-1;
if winner=temp^.data then counter:=counter+1;
if counter=0 then begin winner:=temp^.data; counter:=counter+1 end;
temp:=temp^.next
end;
temp:=head;
counter:=0;
while temp<>nil do
begin
if temp^.data=winner then counter:=counter+1 else counter:=counter-1;
temp:=temp^.next
end;
if counter>0 then writeln('Ž ¤ ¡ž«žª œ ¤˜  ¦',winner:3) else
writeln('ƒœ¤ ¬§˜¨®œ  ¤ ¡ž«žª')
end.




1