cycred function

Cyclic reductions of a word