#include <bits/stdc++.h>
using namespace std;
int T[302][302];
int rowDer[302][302], rowIzq[302][302];
int tp, tu, td;
inline int eval(int cur, int last) {
  if (cur > last) return tu;
  if (cur == last) return tp;
  return td;
}
int der[302][302], izq[302][302];
int main() {
  int n, m, t;
  while (cin >> n >> m >> t) {
    cin >> tp >> tu >> td;
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) scanf("%d", &T[i][j]);
    for (int i = 1; i <= n; i++)
      for (int j = 2; j <= m; j++)
        rowDer[i][j] = rowDer[i][j - 1] + eval(T[i][j], T[i][j - 1]);
    for (int i = 1; i <= n; i++)
      for (int j = m - 1; j >= 1; j--)
        rowIzq[i][j] = rowIzq[i][j + 1] + eval(T[i][j], T[i][j + 1]);
    for (int j = 1; j <= m; j++) {
      for (int i = 2; i <= n; i++) {
        der[j][i] = der[j][i - 1] + eval(T[i][j], T[i - 1][j]);
        izq[j][i] = izq[j][i - 1] + eval(T[i - 1][j], T[i][j]);
      }
    }
    int mini = (1 << 30), ans;
    int f1, c1, c2, f2;
    set<pair<int, int> > S;
    set<pair<int, int> >::iterator it;
    int cost, val;
    pair<int, int> best, aux;
    for (int j = 1; j <= m; j++) {
      if (mini == 0) break;
      for (int k = j + 2; k <= m; k++) {
        if (mini == 0) break;
        S.clear();
        cost = izq[j][n] + der[k][n] + rowIzq[n][j] - rowIzq[n][k];
        S.insert(make_pair(cost, n));
        for (int i = n - 2; i >= 1; i--) {
          cost = rowDer[i][k] - rowDer[i][j] - der[k][i] - izq[j][i];
          val = t - cost;
          best = make_pair(-1, -1);
          if (mini >= cost - t) {
            it = S.lower_bound(make_pair(val, -1));
            if (it != S.end()) best = *it;
            if (it != S.begin()) {
              aux = *(--it);
              if (best.second == -1)
                best = aux;
              else if (abs(aux.first + cost - t) < abs(best.first + cost - t))
                best = aux;
            }
          }
          if (best.second > 0 && mini > abs(best.first + cost - t)) {
            mini = abs(best.first + cost - t);
            f1 = i, f2 = best.second;
            c1 = j, c2 = k;
          }
          cost = izq[j][i + 1] + der[k][i + 1] + rowIzq[i + 1][j] -
                 rowIzq[i + 1][k];
          S.insert(make_pair(cost, i + 1));
        }
      }
    }
    printf("%d %d %d %d\n", f1, c1, f2, c2);
  }
}
