Tree walking automaton
 
x
OK