Problem7639--[CSES Problem Set] Longest Palindrome

7639: [CSES Problem Set] Longest Palindrome

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

Given a string, your task is to determine the longest palindromic 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

$1≤n≤10^6$

Sample 1 Input

aybabtu

Sample 1 Output

bab

HINT

相同题目:CSES 1111

Source/Category