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;
function rev(st:string):boolean;
var f:boolean;
i:integer;
begin
f:=true;
for i:=1 to length(st) div 2 do if st[i]<>st[length(st)-i+1] then
begin
f:=false;
break;
end;
rev:=f;
end;
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;
if rev(slova[i]) then writeln(slova[i]);
end;
readln;
end.