400472: GYM100187 L Ministry of Truth

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

L. Ministry of Truthtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Andrey works in the Ministry of Truth. His work is changing articles in newspapers and magazines so that they praise the Party and Big Brother.

Recently Big Brother decided that it would be fine if all words in all articles are read equally both from right to left and from left to right. In his opinion it will greatly simplify the reading of articles — even if the word is read in the reverse order, its sense won't change.

Andrey spends one second to erase one letter from the word and write another one to its place. Only one word left to be changed, after that he will complete the plan and be able to go home. Of course, he wants to do it as soon as possible. But the truth is that he does not clearly understand right now which word he should get after the replacement. Help him to find it out.

Input

Input contains a single line with the word that Andrey has to change. The word consists of lowercase Latin letters and its length is from 1 to 200000, inclusively.

Output

Output the word which should be a result of Andrey's work. If there are several possible such words, output any of them.

ExamplesInput
abccabd
Output
abacaba
Input
wasitadogoracatiate
Output
wasitacaroracatisaw

加入题单

算法标签: