Solves the Mars Rover problem.