Begin Astar problem 3.

Time limited.