The first line contains N, the side length of the map. (2≤N≤400)
The second line contains four integers Ax, Ay, Bx, By: the x and y coordinates of station A, then the x and y coordinates of station B. The x coordinate is counted from the left and the y coordinate from the top. The two stations sit on different cells. (1≤Ax,Ay,Bx,By≤N)
Each of the next N lines contains N integers C separated by spaces. The jth number on the ith of these lines is the value of the cell with x coordinate j and y coordinate i. A cell that cannot carry track is given as −1. (−1≤C≤106)