#c22303. Secret word

Secret word

Secret Word

Problem Background

UVA 12467

Problem Description

Given a string ss, find the longest "secret word" of ss. A string pp is a "secret word" if:

  • pp is a substring of ss (pp may equal ss);
  • the reverse of pp is a prefix of ss.

Output one line with the string pp you find.

Input Format

One line with a string ss.

Output Format

Output one line with a string, the answer.

Sample Input

listentothesilence

Sample Output

sil

Constraints

For all data: 1≤∣s∣≤1051 \leq |s| \leq 10^5, and ss consists only of lowercase letters.