题目描述
Mirrored Strings
Davy Jones needs to conquer a ship for his pirates. But the only rule he has to follow is to conquer only those ships whose names are partially mirrored at the end.
For Example: If a ship's name is 'abxyzba' then he can conquer the ship because the string has mirrored string at the beginning and at the end i.e 'ab'.
Now your job is to develop a programming code which helps Jones to identify the ships.
Input
First line consists of input string of any length.
Output
Second Line is the appropriate output displaying only the mirrored string.
Example
Input:
abXYZba
Output:
ab
Input:
codechefdoc
Output:
cod
输入格式
见题面
输出格式
见题面
样例输入
abXYZba
样例输出
ab