#C13407. Longest Palindromic Substring

    ID: 42942 Type: Default 1000ms 256MiB

Longest Palindromic Substring

Longest Palindromic Substring

Given a string S, your task is to find the longest palindromic substring. A palindrome reads the same forwards and backwards. The search should be case-insensitive and the resulting palindrome printed in lowercase. In case of multiple palindromic substrings of the same maximum length, output the one that appears first in the string.

Example:

Input:  bananas
Output: anana

Note: The input is read from standard input and the output is printed on standard output.

inputFormat

The input consists of a single line containing the string S. The string may contain letters (both uppercase and lowercase), digits, or be empty.

outputFormat

Output the longest palindromic substring in lowercase. If the input string is empty, output an empty string.

## sample
bananas
anana