Palindrome
Hard
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You are given a non-empty string consisting of lowercase Latin letters. It is allowed to add characters to the beginning and to the end of the string. Add the minimum number of characters to get a palindrome.
Recall that a palindrome is a string that reads the same from left to right and from right to left.
Input
One line consisting of small Latin letters. The string length is from 1 to 10^6
characters.
Output
Print the minimum number of characters that must be added to the original string to get a palindrome.
Examples
Input #1
Answer #1
Submissions 321
Acceptance rate 6%