#include
#include
#include
#include
bool Palindrome(const std::string& str)
{
std::string temp = str;
std::reverse(temp.begin(), temp.end());
return str == temp;
}
void Print(const std::vector& vec)
{
for (const auto &val : vec)
{
std::cout << val << " ";</p>
}
}
int main()
{
std::vector palindromes;
std::string str;
std::cin >> str;
while (str != ".")
{
if (Palindrome(str))
{
palindromes.push_back(str);
}
std::cin >> str;
}
Print(palindromes);
return 0;
}