Cat and dog FSM from FSM chapter