Palindrome. It is a palindrome.
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
In this problem, we define a word as a non-empty sequence of characters, denoted as (a_1a_2...a_n). A palindrome is a word that reads the same forwards and backwards, meaning (a_1a_2...a_n = a_na_n-1...a_1). If we have two words, (S_1 = a_1a_2...a_n) and (S_2 = b_1b_2...b_m), then their concatenation is (S_1S_2 = a_1a_2...a_nb_1b_2...b_m).
You are provided with a word (S_1). Your task is to determine the shortest non-empty word (S_2) such that the concatenation (S_1S_2) forms a palindrome. Note that uppercase and lowercase letters are distinct.
Input
The input consists of a single line containing (S_1), which is composed solely of Latin characters.
The length of (S_1) is guaranteed not to exceed 100,000 characters.
Output
Output the palindrome (S_1S_2).
Examples
Input #1
Answer #1
Submissions 249
Acceptance rate 30%