Text this: Applied combinatorics on words / M. Lothaire.