#include <bits/stdc++.h>
using namespace std;
const long long N = 305, oo = 1e9;
long long Right[N][N], Left[N][N], Up[N][N], Down[N][N], a[N][N], n, res = oo,
                                                                     m, lazy[N];
long long up, down, flat, t;
pair<long long, long long> res1, res2;
long long go(long long a, long long b) {
  if (a < b) return up;
  if (a > b) return down;
  if (a == b) return flat;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> t >> flat >> up >> down;
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j <= m; ++j) {
      cin >> a[i][j];
    }
  }
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j <= m; ++j) {
      if (j != 1) Right[i][j] = Right[i][j - 1] + go(a[i][j - 1], a[i][j]);
      if (j != 1) Left[i][j] = Left[i][j - 1] + go(a[i][j], a[i][j - 1]);
      if (i == 1) continue;
      Up[i][j] = Up[i - 1][j] + go(a[i][j], a[i - 1][j]);
      Down[i][j] = Down[i - 1][j] + go(a[i - 1][j], a[i][j]);
    }
  }
  for (long long c1 = 1; c1 <= m; ++c1) {
    for (long long c2 = c1 + 1; c2 <= m; ++c2)
      if (c2 - c1 > 1) {
        long long cur1, cur2;
        cur1 = cur2 = 0;
        set<pair<long long, long long> > S;
        S.clear();
        lazy[1] = Right[1][c2] - Right[1][c1];
        for (long long i = 2; i <= n; ++i) {
          cur1 = Up[i][c1], cur2 = Down[i][c2];
          long long now = Left[i][c2] - Left[i][c1];
          long long nxt = Right[i][c2] - Right[i][c1];
          set<pair<long long, long long> >::iterator it = S.lower_bound(
              pair<long long, long long>(t - cur1 - cur2 - now, 0));
          if (it != S.end()) {
            long long val = (*it).first;
            long long id = (*it).second;
            res = min(res, cur1 + cur2 + val + now - t);
            if (res == cur1 + cur2 + val + now - t) {
              if (res == 0) {
                cout << id << ' ' << c1 << ' ' << i << ' ' << c2 << endl;
                return 0;
              }
              res1 = pair<long long, long long>(id, c1);
              res2 = pair<long long, long long>(i, c2);
            }
          }
          if (it != S.begin()) {
            it--;
            long long val = (*it).first;
            long long id = (*it).second;
            res = min(res, abs(cur1 + cur2 + val + now - t));
            if (res == abs(cur1 + cur2 + val + now - t)) {
              if (res == 0) {
                cout << id << ' ' << c1 << ' ' << i << ' ' << c2 << endl;
                return 0;
              }
              res1 = pair<long long, long long>(id, c1);
              res2 = pair<long long, long long>(i, c2);
            }
          }
          lazy[i] = nxt - cur1 - cur2;
          S.insert(pair<long long, long long>(lazy[i - 1], i - 1));
        }
      }
  }
  cout << res1.first << ' ' << res1.second << ' ' << res2.first << ' '
       << res2.second << endl;
  return 0;
}
