#include <bits/stdc++.h>
using namespace std;
int n, m, t, tp, tu, td;
int B[303][303];
int bestr1, bestc1, bestr2, bestc2;
int16_t rows[303][303][303][2];
int16_t cols[303][303][303][2];
int calcRow(int r, int c1, int c2, bool reverse) {
  int u = rows[r][c1][c2][0];
  int d = rows[r][c1][c2][1];
  int p = c2 - c1 - u - d;
  if (reverse) {
    swap(u, d);
  }
  return tu * u + td * d + tp * p;
}
int calcCol(int c, int r1, int r2, bool reverse) {
  int u = cols[c][r1][r2][0];
  int d = cols[c][r1][r2][1];
  int p = r2 - r1 - u - d;
  if (reverse) {
    swap(u, d);
  }
  return tu * u + td * d + tp * p;
}
int getTrackTime(int r1, int c1, int r2, int c2) {
  int ret = 0;
  ret += calcRow(r1, c1, c2, false);
  ret += calcCol(c2, r1, r2, false);
  ret += calcRow(r2, c1, c2, true);
  ret += calcCol(c1, r1, r2, true);
  return ret;
}
void precalc() {
  memset(rows, 0, sizeof(rows));
  for (int r = 1; r <= n; r++) {
    for (int c1 = 1; c1 <= m; c1++) {
      int u = 0, d = 0, p = 0;
      for (int c2 = c1 + 1; c2 <= m; c2++) {
        if (B[r][c2 - 1] == B[r + 0][c2 - 1 + 1]) {
          p++;
        } else if (B[r][c2 - 1] > B[r + 0][c2 - 1 + 1]) {
          d++;
        } else {
          u++;
        };
        rows[r][c1][c2][0] = u;
        rows[r][c1][c2][1] = d;
      }
    }
  }
  memset(cols, 0, sizeof(cols));
  for (int c = 1; c <= m; c++) {
    for (int r1 = 1; r1 <= n; r1++) {
      int u = 0, d = 0, p = 0;
      for (int r2 = r1 + 1; r2 <= n; r2++) {
        if (B[r2 - 1][c] == B[r2 - 1 + 1][c + 0]) {
          p++;
        } else if (B[r2 - 1][c] > B[r2 - 1 + 1][c + 0]) {
          d++;
        } else {
          u++;
        };
        cols[c][r1][r2][0] = u;
        cols[c][r1][r2][1] = d;
      }
    }
  }
}
int f(int r1, int c1, int r2, int c2) {
  return abs(getTrackTime(r1, c1, r2, c2) - t);
}
void searchR2(int r1, int c1, int c2) {
  int r2l = r1 + 2, r2u = n;
  if (r2l > r2u) {
    return;
  }
  while (r2l < r2u) {
    int middle = (r2u + r2l) / 2;
    int res = getTrackTime(r1, c1, middle, c2);
    if (res < t) {
      r2l = middle + 1;
    } else {
      r2u = middle;
    }
  }
  int to = r2l + 2;
  for (int i = r2l - 2; i <= to; i++) {
    if (i - r1 + 1 >= 3 && i <= n && f(r1, c1, i, c2) < f(r1, c1, r2l, c2)) {
      r2l = i;
    }
  }
  if (false) {
    cout << "tt(" << r1 << ", " << c1 << ", " << r2l << ", " << c2 << ") = ";
    cout << getTrackTime(r1, c1, r2l, c2);
    cout << endl;
  }
  if (f(bestr1, bestc1, bestr2, bestc2) >= f(r1, c1, r2l, c2)) {
    bestr1 = r1;
    bestc1 = c1;
    bestr2 = r2l;
    bestc2 = c2;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  while (cin >> n >> m >> t) {
    cin >> tp >> tu >> td;
    for (int r = 1; r <= n; r++) {
      for (int c = 1; c <= m; c++) {
        cin >> B[r][c];
      }
    }
    precalc();
    bestr1 = 1;
    bestc1 = 1;
    bestr2 = 3;
    bestc2 = 3;
    for (int r1 = 1; r1 <= n; r1++) {
      for (int c1 = 1; c1 <= m; c1++) {
        for (int c2 = c1 + 2; c2 <= m; c2++) {
          searchR2(r1, c1, c2);
        }
      }
    }
    cout << bestr1 << " " << bestc1 << " " << bestr2 << " " << bestc2 << endl;
  }
  return 0;
}
