#include <bits/stdc++.h>
using namespace std;
const int N = 300;
const int INF = 1e9;
int tp, tu, td, a[N][N], L[N][N][N], R[N][N][N], add[N];
int go(int x1, int y1, int x2, int y2) {
  return (a[x1][y1] < a[x2][y2] ? tu : (a[x1][y1] > a[x2][y2] ? td : tp));
}
int abs(int x) { return x >= 0 ? x : -x; }
int main() {
  int n, m, t, ans = INF, ansL, ansR, ansU, ansD;
  cin >> n >> m >> t >> tp >> tu >> td;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int k = j + 1; k < m; k++)
        R[i][j][k] = R[i][j][k - 1] + go(i, k - 1, i, k);
  for (int i = 0; i < n; i++)
    for (int k = m - 1; k >= 0; k--)
      for (int j = k - 1; j >= 0; j--)
        L[i][j][k] = L[i][j + 1][k] + go(i, j + 1, i, j);
  for (int j = 0; j < m; j++)
    for (int k = j + 2; k < m; k++) {
      set<pair<int, int> > st;
      for (int i = 0; i < n; i++) {
        int delta = i ? (go(i, j, i - 1, j) + go(i - 1, k, i, k)) : 0;
        add[i] = (i ? add[i - 1] : 0) + delta;
        int now = L[i][j][k];
        if (i >= 2) {
          int was = R[i - 2][j][k];
          st.insert(make_pair(was - add[i - 2], i - 2));
          int want = t - add[i] - now;
          set<pair<int, int> >::iterator l, r;
          l = st.lower_bound(make_pair(want, 0));
          r = st.upper_bound(make_pair(want, 0));
          r--;
          if (l != st.end() && abs(want - l->first) < ans) {
            ans = abs(want - l->first);
            ansU = l->second;
            ansD = i;
            ansL = j;
            ansR = k;
          }
          if (r != st.end() && abs(want - r->first) < ans) {
            ans = abs(want - r->first);
            ansU = r->second;
            ansD = i;
            ansL = j;
            ansR = k;
          }
        }
      }
    }
  cout << ansU + 1 << ' ' << ansL + 1 << ' ' << ansD + 1 << ' ' << ansR + 1
       << endl;
  return 0;
}
