Recently an official statement of the world Olympic Committee said that the Olympic Winter Games 2030 will be held in Tomsk. The city officials decided to prepare for the Olympics thoroughly and to build all the necessary Olympic facilities as early as possible. First, a biathlon track will be built.

To construct a biathlon track a plot of land was allocated, which is a rectangle divided into *n* × *m* identical squares. Each of the squares has two coordinates: the number of the row (from 1 to *n*), where it is located, the number of the column (from 1 to *m*), where it is located. Also each of the squares is characterized by its height. During the sports the biathletes will have to move from one square to another. If a biathlete moves from a higher square to a lower one, he makes a descent. If a biathlete moves from a lower square to a higher one, he makes an ascent. If a biathlete moves between two squares with the same height, then he moves on flat ground.

The biathlon track should be a border of some rectangular area of the allocated land on which biathletes will move in the clockwise direction. It is known that on one move on flat ground an average biathlete spends *t*<sub class="lower-index">*p*</sub> seconds, an ascent takes *t*<sub class="lower-index">*u*</sub> seconds, a descent takes *t*<sub class="lower-index">*d*</sub> seconds. The Tomsk Administration wants to choose the route so that the average biathlete passes it in as close to *t* seconds as possible. In other words, the difference between time *t*<sub class="lower-index">*s*</sub> of passing the selected track and *t* should be minimum.

For a better understanding you can look at the first sample of the input data. In this sample *n* = 6, *m* = 7, and the administration wants the track covering time to be as close to *t* = 48 seconds as possible, also, *t*<sub class="lower-index">*p*</sub> = 3, *t*<sub class="lower-index">*u*</sub> = 6 and *t*<sub class="lower-index">*d*</sub> = 2. If we consider the rectangle shown on the image by arrows, the average biathlete can move along the boundary in a clockwise direction in exactly 48 seconds. The upper left corner of this track is located in the square with the row number 4, column number 3 and the lower right corner is at square with row number 6, column number 7.

Among other things the administration wants all sides of the rectangle which boundaries will be the biathlon track to consist of no less than three squares and to be completely contained within the selected land.

You are given the description of the given plot of land and all necessary time values. You are to write the program to find the most suitable rectangle for a biathlon track. If there are several such rectangles, you are allowed to print any of them.
The first line of the input contains three integers *n*, *m* and *t* (3 ≤ *n*, *m* ≤ 300, 1 ≤ *t* ≤ 10<sup class="upper-index">9</sup>) — the sizes of the land plot and the desired distance covering time.

The second line also contains three integers *t*<sub class="lower-index">*p*</sub>, *t*<sub class="lower-index">*u*</sub> and *t*<sub class="lower-index">*d*</sub> (1 ≤ *t*<sub class="lower-index">*p*</sub>, *t*<sub class="lower-index">*u*</sub>, *t*<sub class="lower-index">*d*</sub> ≤ 100) — the time the average biathlete needs to cover a flat piece of the track, an ascent and a descent respectively.

Then *n* lines follow, each line contains *m* integers that set the heights of each square of the given plot of land. Each of the height values is a positive integer, not exceeding 10<sup class="upper-index">6</sup>.
import itertools


n, m, t = tuple(map(int, str.split(input())))
tp, tu, td = tuple(map(int, str.split(input())))

rows_right, rows_left = [], []
columns_up = list(map(lambda _: list(), range(m)))
columns_down = list(map(lambda _: list(), range(m)))
prev_line = None
for _ in range(n):

    line = tuple(map(int, str.split(input())))
    rows_right.append([])
    rows_left.append([])
    for i in range(m - 1):

        if line[i] > line[i + 1]:

            rows_right[-1].append(td)
            rows_left[-1].append(tu)

        elif line[i] < line[i + 1]:

            rows_right[-1].append(tu)
            rows_left[-1].append(td)

        else:

            rows_right[-1].append(tp)
            rows_left[-1].append(tp)

    if prev_line is not None:

        for i in range(m):

            if prev_line[i] > line[i]:

                columns_down[i].append(td)
                columns_up[i].append(tu)

            elif prev_line[i] < line[i]:

                columns_down[i].append(tu)
                columns_up[i].append(td)

            else:

                columns_down[i].append(tp)
                columns_up[i].append(tp)

    prev_line = line


best = None
best_delta = None
for tlx, tly in itertools.product(range(m - 2), range(n - 2)):

    if best_delta is not None and best_delta == 0:

        break

    for brx in range(tlx + 2, m):

        cdelta = t - sum(rows_right[tly][tlx:brx])
        if best_delta is not None and cdelta < 0 and abs(cdelta) > abs(best_delta):

            # break
            pass

        for bry in range(tly + 2, n):

            ncdelta = cdelta - sum(columns_down[brx][tly:bry]) - sum(rows_left[bry][tlx:brx]) - sum(columns_up[tlx][tly:bry])
            if best_delta is None or abs(ncdelta) < abs(best_delta):

                best = (tly, tlx, bry, brx)
                best_delta = ncdelta

# print(best_delta)
print(str.join(" ", map(lambda x: str(x + 1), best)))
tly, tlx, bry, brx = best
# print(sum(rows_right[tly][tlx:brx]))
# print(sum(columns_down[brx][tly:bry]))
# print(sum(rows_left[bry][tlx:brx]))
# print(sum(columns_up[tlx][tly:bry]))
