Solves mazes