shortest path with left, right, top and bottom move