#P3622. Lyndon Factorization

Lyndon Factorization

babaabaab
0 1 3 6 9
ababacaca
0 8 9