Code Submission Evaluation System Login

CSES Problem Set

Longest Palindrome


Task | Statistics


CSES - Longest Palindrome

Time limit:1.00 s Memory limit:512 MB

Given a string, your task is to determine the longest palindrome that is a substring of the string. For example, the longest palindrome in aybabtu is bab.

Input

The only input line contains a string of length $n$. Each character is one of a–z.

Output

Print the longest palindrome in the string. If there are several solutions, you may print any of them.

Constraints
Example

Input:
aybabtu

Output:
bab