Mealy Machine