Cercalo Ovunque!
Dato un testo molto lungo
t
, l’azienda vuole individuare la sottostringa più lunga s
che rispetti diverse condizioni:s
è un prefisso dit
s
è un suffisso dit
s
è una sottostringa dit
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