Cercalo Ovunque!

Dato un testo molto lungo t, l’azienda vuole individuare la sottostringa più lunga s che rispetti diverse condizioni:

  • s è un prefisso di t

  • s è un suffisso di t

  • s è una sottostringa di t

Riesci ad aiutarli a trovarla?

Input

L’unica riga di input contiene il testo t (1 ≤ |t| ≤ ).

Output

Il programma deve stampare la sottostringa più lunga s che rispetta tutte le condizioni, oppure Impossible se non è possibile trovarne una.

Esempi

Input

Output

fixfixfix

fix

hello

Impossible

abcabdab

ab

Constraints

Time limit: 5 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue