var s:string;
start,finish,i:integer;
Begin
{read(s);}
s:='I aha, go home i';
start:=1;
for i := 2 to length(s)+1 do begin
if (s[i] in [' ',',','.']) or (i=length(s)) then begin
finish:=i-1;
if s[start]=s[finish] then writeln(copy(s,start, finish-start+1));
start:=i+1;
end;
end;
End.