program kkk;
uses crt;
const possible:set of char=['0'..'9','a'..'z','A'..'Z','_'];
var count,i,j:integer;
f:boolean;
st,buf:string;
slova:array[1..100]of string;
begin
clrscr;
readln(st);
count:=1;
repeat
if (st[1]=' ') or (length(st)=1) then while st[1]=' ' do delete(st,1,1)
else
begin
while (st[1]<>' ') and (length(st)>1) do
begin
buf:=buf+st[1];
delete(st,1,1);
end;
slova[count]:=buf;
buf:='';
inc(count);
end;
until (length(st)=1) and (length(buf)=0);
for i:=1 to count-1 do
begin
f:=true;
for j:=1 to length(slova[i]) div 2 do if slova[i][j]<>slova[i][length(slova[i])-j+1] then
begin
f:=false;
break;
end;
if f then writeln(slova[i]);
end;
readln;
end.