uses
System.Collections.Generic;
function reverse(const s: String): String;
begin
if Length(s) = 1 then reverse := s else
reverse := s[Length(s)] + reverse(Copy(s, 1, Length(s) - 1));
end;
var
lst: List := new List();
s, s1: string;
begin
writeln('Конец последовательности - пустая строка');
while (true) do
begin
readln(s);
if (s.Length = 0) then
break
else
lst.Add(s);
end;
writeln();
foreach s in lst do
begin
if ((s <> lst.Last()) and (s = reverse(s))) then
writeln(s);
end;
end.