Shortest Palindrome

hard
1. You are given string(str). 
2. You can convert the given string to a palindrome by adding some characters in front of it.
3. You have to find the shortest palindromic string formed after performing the above-mentioned transformation. 

Input Format

A string

Output Format

A string

Constraints

1 <= length of the string <= 10^4

Example

Input
coding
Output
gnidocoding
Previous
Subdomain Visit Count
Next
Circle Maniac

Related Questions