This program simulate an finite automaton