Mealy machine with output. But Moore with output too.