#include <bits/stdc++.h>
using namespace std;
long long R[305][305], D[305][305], L[305][305], U[305][305];
int a[305][305], n, m, t, tp, tu, td;
set<pair<long long, int> > S;
set<pair<long long, int> >::iterator it;
int Lx, Ly, Rx, Ry;
int cmp(const int &x, const int &y) { return x == y ? tp : (x < y ? tu : td); }
int main() {
  scanf("%d%d%d", &n, &m, &t);
  scanf("%d%d%d", &tp, &tu, &td);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &a[i][j]);
  for (int i = 1; i <= n; ++i)
    for (int j = 2; j <= m; ++j)
      R[i][j] = R[i][j - 1] + cmp(a[i][j - 1], a[i][j]);
  for (int i = 1; i <= m; ++i)
    for (int j = 2; j <= n; ++j)
      D[i][j] = D[i][j - 1] + cmp(a[j - 1][i], a[j][i]);
  for (int i = 1; i <= n; ++i)
    for (int j = m - 1; j >= 1; --j)
      L[i][j] = L[i][j + 1] + cmp(a[i][j + 1], a[i][j]);
  for (int i = 1; i <= m; ++i)
    for (int j = n - 1; j >= 1; --j)
      U[i][j] = U[i][j + 1] + cmp(a[j + 1][i], a[j][i]);
  long long ans = 1e15;
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 2; j <= n; ++j) {
      S.clear();
      for (int k = m - 2; k >= 1; --k) {
        int x = k + 2;
        long long v = t - (U[k][i] - U[k][j]) + R[i][k] - L[j][k];
        S.insert(make_pair(R[i][x] - L[j][x] + D[x][j] - D[x][i], x));
        it = S.lower_bound(make_pair(v, -0x3f3f3f3f));
        if (it == S.end()) {
          --it;
          if (abs((*it).first - v) < ans) {
            ans = abs((*it).first - v);
            Lx = i, Ly = k;
            Rx = j, Ry = (*it).second;
          }
        } else {
          if (abs((*it).first - v) < ans) {
            ans = abs((*it).first - v);
            Lx = i, Ly = k;
            Rx = j, Ry = (*it).second;
          }
          if (it != S.begin()) {
            --it;
            if (abs((*it).first - v) < ans) {
              ans = abs((*it).first - v);
              Lx = i, Ly = k;
              Rx = j, Ry = (*it).second;
            }
          }
        }
      }
    }
  }
  printf("%d %d %d %d\n", Lx, Ly, Rx, Ry);
  return 0;
}
