#C3364. Longest Palindrome Substring

    ID: 46783 Type: Default 1000ms 256MiB

Longest Palindrome Substring

Longest Palindrome Substring

Given a string s, find the longest palindromic substring contained within it. A palindrome is a sequence that reads the same forwards and backwards when all non-alphanumeric characters are removed and all letters are converted to lowercase. If multiple palindromic substrings of maximum length exist, return the one that appears first in the processed string.

For instance, the input "A man, a plan, a canal, Panama" should be preprocessed to "amanaplanacanalpanama", which is a palindrome.

The solution should read from standard input (stdin) and write the result to standard output (stdout).

inputFormat

The input consists of a single line read from stdin that contains the string s. The string may include spaces, punctuation, and a mix of uppercase and lowercase letters.

outputFormat

Output the longest palindromic substring found in the preprocessed string. The result should be printed to stdout.

## sample
a
a