https://123dok.net/document/y6e874gz-finite-transducers-for-divisibility-monoids.html