Code Submission Evaluation System Login

CSES Problem Set

Longest Border


Task | Statistics


CSES - Longest Border

Time limit:1.00 s Memory limit:512 MB

A border of a string is both a prefix and suffix of the string and not the entire string. For example, the longest border of acbdacb is acb.

Your task is to determine the longest border of a given string.

Input

The only input line contains a string of length $n$. Each character is one of a–z.

Output

Print the longest border of the string. You may assume that it is not empty.

Constraints
Example

Input:
acbdacb

Output:
acb