Maximum Subpalindrome#1740

Maximum Subpalindrome

1 second
64 megabytes
Very easy

A palindrome is a string that reads the same forwards and backwards. A sub-palindrome of a given string is a sequence of characters from that string, which do not have to be consecutive, that forms a palindrome. For example, HELOLEH is a sub-palindrome of the string HTEOLFEOLEH. Write a program to find the longest sub-palindrome in a given string.

Input

The input file contains a string with a maximum length of characters, consisting of uppercase Latin letters.

Output

Output the length of the longest sub-palindrome on the first line of the output file, and the longest sub-palindrome itself on the second line. If there are multiple longest sub-palindromes, your program can output any one of them.

Examples

Example 1

Loading
Loading