eolymp
bolt
Try our new interface for solving problems
Problems

Palindrome

Palindrome

Given a string \textbf{S}. Required to find it along the length of the substring masimalnuyu, which is a palindrome. \InputFile The input file is given a string \textbf{S} (\textbf{1} ≤ |\textbf{S}| ≤ \textbf{1000}), consisting of Latin capital letters. \OutputFile You want to display a substring, palindrome. If there are multiple answers, you want to display a substring that occurs in \textbf{S} before.
Time limit 1 second
Memory limit 64 MiB
Input example #1
ABAC
Output example #1
ABA
Input example #2
ABBCB
Output example #2
BCB