#include <bits/stdc++.h>
using namespace std;
int abs(int a) { return (a > 0) ? a : -a; }
int main() {
  int n, m, t = 0;
  cin >> n >> m >> t;
  int a[300][300];
  memset(a, 0, sizeof a);
  int ti, tu, td;
  cin >> ti >> tu >> td;
  for (int i = 0; i < n; ++i) {
    int* aa = a[i];
    for (int j = 0; j < m; ++j) scanf("%d", aa + j);
  }
  int res = 1e9;
  int hr[300][300], hl[300][300];
  int vd[300][300], vu[300][300];
  memset(hr, 0, sizeof hr);
  memset(hl, 0, sizeof hl);
  memset(vd, 0, sizeof vd);
  memset(vu, 0, sizeof vu);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m - 1; ++j) {
      if (a[i][j] == a[i][j + 1])
        hr[i][j + 1] = ti, hl[i][j] = ti;
      else if (a[i][j] > a[i][j + 1])
        hr[i][j + 1] = td, hl[i][j] = tu;
      else
        hr[i][j + 1] = tu, hl[i][j] = td;
    }
    for (int j = 1; j < m; ++j) hr[i][j] += hr[i][j - 1];
    for (int j = m - 2; j >= 0; --j) hl[i][j] += hl[i][j + 1];
  }
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i < n - 1; ++i) {
      if (a[i][j] == a[i + 1][j])
        vd[i + 1][j] = ti, vu[i][j] = ti;
      else if (a[i][j] > a[i + 1][j])
        vd[i + 1][j] = td, vu[i][j] = tu;
      else
        vd[i + 1][j] = tu, vu[i][j] = td;
    }
    for (int i = 1; i < n; ++i) vd[i][j] += vd[i - 1][j];
    for (int i = n - 2; i >= 0; --i) vu[i][j] += vu[i + 1][j];
  }
  int p0 = 0, p1 = 0, p2 = 0, p3 = 0;
  for (int i0 = 0; i0 < n - 2; ++i0) {
    for (int j0 = 0; j0 < m - 2; ++j0) {
      int s0 = vu[i0][j0] - hr[i0][j0];
      for (int i1 = i0 + 2; i1 < n; ++i1) {
        int s1 = s0 + hl[i1][j0] - vu[i1][j0];
        for (int j1 = j0 + 2; j1 < m; ++j1) {
          int s = s1 + hr[i0][j1] - hl[i1][j1] + vd[i1][j1] - vd[i0][j1];
          s = abs(s - t);
          if (s < res) res = s, p0 = i0, p1 = j0, p2 = i1, p3 = j1;
        }
      }
    }
  }
  cout << 1 + p0 << " " << 1 + p1 << " " << 1 + p2 << " " << 1 + p3 << endl;
  return 0;
}
