Santa-fe trail problem