Palindrome#2709

Palindrome

1 second
64 megabytes
Easy

Given a string . Find the longest substring in that is a palindrome.

Input

The input contains a string (1 \leq |S| \leq 1000) consisting of uppercase Latin letters.

Output

Output a palindromic substring of of maximal length. If there are multiple answers, output the substring that appears first in .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading