Finite Automata - Mealy Machine