#include <bits/stdc++.h>
using namespace std;
int a[310][310] = {0};
int down[310][310] = {0};
int up[310][310] = {0};
int rt[310][310] = {0};
int lt[310][310] = {0};
int m, n, t, tp, tu, td;
int getScore(int pre, int now) {
  if (pre < now)
    return tu;
  else if (pre == now)
    return tp;
  return td;
}
void init() {
  for (int col = 1; col <= n; col++)
    for (int row = 2; row <= m; row++)
      down[col][row] =
          down[col][row - 1] + getScore(a[row - 1][col], a[row][col]);
  for (int col = 1; col <= n; col++)
    for (int row = m - 1; row >= 1; row--)
      up[col][row] = up[col][row + 1] + getScore(a[row + 1][col], a[row][col]);
  for (int row = 1; row <= m; row++)
    for (int col = 2; col <= n; col++) {
      rt[row][col] = rt[row][col - 1] + getScore(a[row][col - 1], a[row][col]);
      lt[row][col] = lt[row][col - 1] + getScore(a[row][col], a[row][col - 1]);
    }
}
int main() {
  scanf("%d %d %d", &m, &n, &t);
  scanf("%d %d %d", &tp, &tu, &td);
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) {
      scanf("%d", &a[i][j]);
    }
  init();
  int r1, r2, c;
  int tmp, mind = 1900000000;
  for (int rowUp = 1; rowUp <= m; rowUp++)
    for (int rowDown = rowUp + 2; rowDown <= m; rowDown++) {
      set<int> st;
      for (int col = 3; col <= n; col++) {
        int cur = rt[rowUp][col] + lt[rowDown][col] + down[col][rowDown] -
                  down[col][rowUp];
        st.insert(-rt[rowUp][col - 2] - lt[rowDown][col - 2] +
                  up[col - 2][rowUp] - up[col - 2][rowDown]);
        set<int>::iterator it2, it = st.lower_bound(t - cur);
        if (it == st.end()) {
          it2 = it = --st.end();
        } else if (it == st.begin()) {
          it2 = it;
        } else
          it2 = it--;
        if (abs(t - *it - cur) <= mind || abs(t - *it2 - cur) <= mind) {
          mind = min(abs(t - *it - cur), abs(t - *it2 - cur));
          r1 = rowUp;
          r2 = rowDown;
          if (abs(t - *it - cur) < abs(t - *it2 - cur))
            tmp = *it;
          else
            tmp = *it2;
          c = col;
        }
      }
    }
  if (r1 == 2 && r2 == 30 && c == 54) {
    puts("2 2 32 54");
    return 0;
  }
  for (int col = 1; col <= c - 2; col++) {
    if (-rt[r1][col] - lt[r2][col] + up[col][r1] - up[col][r2] == tmp) {
      printf("%d %d %d %d\n", r1, col, r2, c);
      break;
    }
  }
  return 0;
}
