#include <bits/stdc++.h>
using namespace std;
int ma[305][305], up[305][305], down[305][305], rg[306][305], lf[305][305], n,
    m, T;
int tp, tu, td;
void lfAndRg() {
  for (int i = 0; i < n; i++) {
    rg[i][0] = 0;
    for (int j = 1; j < m; j++) {
      if (ma[i][j] > ma[i][j - 1]) rg[i][j] = rg[i][j - 1] + tu;
      if (ma[i][j] < ma[i][j - 1]) rg[i][j] = rg[i][j - 1] + td;
      if (ma[i][j] == ma[i][j - 1]) rg[i][j] = rg[i][j - 1] + tp;
    }
    lf[i][m - 1] = 0;
    for (int j = m - 2; j >= 0; j--) {
      if (ma[i][j] > ma[i][j + 1]) lf[i][j] = lf[i][j + 1] + tu;
      if (ma[i][j] < ma[i][j + 1]) lf[i][j] = lf[i][j + 1] + td;
      if (ma[i][j] == ma[i][j + 1]) lf[i][j] = lf[i][j + 1] + tp;
    }
  }
}
void upAndDown() {
  for (int j = 0; j < m; j++) {
    down[0][j] = 0;
    for (int i = 1; i < n; i++) {
      if (ma[i][j] > ma[i - 1][j]) down[i][j] = down[i - 1][j] + tu;
      if (ma[i][j] < ma[i - 1][j]) down[i][j] = down[i - 1][j] + td;
      if (ma[i][j] == ma[i - 1][j]) down[i][j] = down[i - 1][j] + tp;
    }
    up[n - 1][j] = 0;
    for (int i = n - 2; i >= 0; i--) {
      if (ma[i][j] > ma[i + 1][j]) up[i][j] = up[i + 1][j] + tu;
      if (ma[i][j] < ma[i + 1][j]) up[i][j] = up[i + 1][j] + td;
      if (ma[i][j] == ma[i + 1][j]) up[i][j] = up[i + 1][j] + tp;
    }
  }
}
void print() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << rg[i][j] << " ";
    cout << endl;
  }
}
void print2() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << lf[i][j] << " ";
    cout << endl;
  }
}
void print3() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << up[i][j] << " ";
    cout << endl;
  }
}
void print4() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << down[i][j] << " ";
    cout << endl;
  }
}
int sum(int row1, int row2, int col) {
  int suma = 0;
  suma += rg[row1][col];
  suma += lf[row2][0] - lf[row2][col];
  suma -= (up[row1][col] - up[row2][col]);
  return suma;
}
int sum2(int row1, int row2, int col) {
  int suma = 0;
  suma += rg[row1][col];
  suma += lf[row2][0] - lf[row2][col];
  suma += down[row2][col];
  suma -= down[row1][col];
  return suma;
}
int main() {
  int x1, y1, x2, y2, ans = 1000000000;
  cin >> n >> m >> T;
  cin >> tp >> tu >> td;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> ma[i][j];
  lfAndRg();
  upAndDown();
  set<pair<int, int> > res;
  set<pair<int, int> >::iterator it;
  int val, idx, cost;
  for (int i = 0; i < n; i++) {
    for (int l = i + 2; l < n; l++) {
      res.clear();
      for (int j = 2; j < m; j++) {
        res.insert(make_pair(sum(i, l, j - 2), j - 2));
        val = sum2(i, l, j);
        it = res.lower_bound(make_pair(val - T, 0));
        if (it != res.end()) {
          idx = (*it).second;
          cost = (*it).first;
          if (abs(T - (val - cost)) < ans) {
            ans = abs(T - (val - cost));
            x1 = i;
            y1 = idx;
            x2 = l;
            y2 = j;
          }
        }
        if (it != res.begin()) {
          it--;
          idx = (*it).second;
          cost = (*it).first;
          if (abs(T - (val - cost)) < ans) {
            ans = abs(T - (val - cost));
            x1 = i;
            y1 = idx;
            x2 = l;
            y2 = j;
          }
        }
      }
    }
  }
  cout << ++x1 << " " << ++y1 << " " << ++x2 << " " << ++y2 << "\n";
  return 0;
}
