Ave and Reverse strings

5

1 votes
Easy
Problem

Today Alice is teaching her bot Ave how to read backwards. But Alice got an idea to test whether Ave is mentally there. So, Alice gave Ave task to catch those words which are also there while read forward. But since, Ave is bored of reading backwards by now. He wants your help to make program to catch those words while read backwards are also there while read forwards.

Input:

First line contains some words with lower case letters

Output:

Output those words backwards order that too in order of which came first while reading backwards.

Print each word in a newline.

If there are no such words then print "-1" without quotes

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?