LearnPy Hub
← Arena
AdvancedRating 1700

All Palindrome Splits

Print every way to split the string into pieces that are all palindromes, pieces separated by spaces, one split per line, in the order found by trying shorter first pieces first.

Input

One string (length ≤ 12).

Output

Lines.

Sample 1

Input
aab
Output
a a b
aa b

Sample 2

Input
a
Output
a
solution.py
Output appears here
All Palindrome Splits · Python Arena problem · LearnPy Hub