Travel company decided to develop trails in the mountainous region. All routes start at the collection point and end at the departure point. Help create as many routes of minimal length as possible. The length of a route is the number of cells it passes through.
A map of the area is given as an M \times N array. Each cell contains a natural number representing the altitude of the terrain. Tourists can move from one cell to another through a common side if the height difference does not exceed .
The first line contains numbers: the map dimensions , , the coordinates of the collection point , , and the coordinates of the departure point , (row number and column number). Then lines follow, each containing natural numbers: the altitudes of the terrain (values do not exceed ). M, N = 1..30.
Output a single number: the number of routes of minimal length, or -1 if it is impossible to construct such a route.
Example 1