URAL 1297. Palindrome(输出最长回文子串--后缀数组)

Input

The input consists of a single line, which contains a string of Latin alphabet letters (no other characters will appear in the string). String length will not exceed 1000 characters.

Output

The longest substring with mentioned property. If there are several such strings you should output the first of them.

Sample

input output
ThesampletextthatcouldbereadedthesameinbothordersArozaupalanalapuazorA
ArozaupalanalapuazorA
Problem Author: Eugene Krokhalev
Problem Source: IX Open Collegiate Programming Contest of the High School Pupils (13.03.2004)
Tags:  string algorithms   ( hide tags for unsolved problems )

你可能感兴趣的:(URAL 1297. Palindrome(输出最长回文子串--后缀数组))