JCC25 Contest 2 P4 - Palindromes
Doing good so far! Good job getting through half of the tasks.
After coming home from a date with that special someone, Jason has now decided to dedicate himself to the field of linguistics. After borrowing an introductory book home from the library, he is horrified to realize he is struggling on the first problem. Thankfully, you are by his side, and can help him out.
Please help Jason print all the palindromes with length longer than \(1\), in lexicographic order that appear in the string.
Constraints
\(1 \le |S| \le 200\)
Input Specification
The first line will contain the string \(S\).
Output Specification
Output all palindromes that appear in the string in lexicographic order.
Sample Input
abccbabab
Sample Output
aba
abccba
bab
babab
bccb
cc
Comments