#include <bits/stdc++.h>
using namespace std;
long long n, m, t, p, u, d;
set<pair<long long, int> > sums;
map<long long, long long> mapping;
inline int calc(long long &prev, long long &next) {
  if (prev > next) return d;
  if (next > prev) return u;
  return p;
}
int main() {
  scanf("%lli %lli %lli", &n, &m, &t);
  scanf("%lli %lli %lli", &p, &u, &d);
  long long grid[n][m], lr[n][m], rl[n][m], ud[n][m], du[n][m];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%lli", &grid[i][j]);
  for (int i = 0; i < n; i++) lr[i][0] = rl[i][0] = 0;
  for (int j = 0; j < m; j++) ud[0][j] = du[n - 1][j] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 1; j < m; j++)
      lr[i][j] = lr[i][j - 1] + calc(grid[i][j - 1], grid[i][j]);
  for (int i = 0; i < n; i++)
    for (int j = 1; j < m; j++)
      rl[i][j] = rl[i][j - 1] + calc(grid[i][j], grid[i][j - 1]);
  for (int j = 0; j < m; j++)
    for (int i = 1; i < n; i++)
      ud[i][j] = ud[i - 1][j] + calc(grid[i - 1][j], grid[i][j]);
  for (int j = 0; j < m; j++)
    for (int i = n - 2; i >= 0; i--)
      du[i][j] = du[i + 1][j] + calc(grid[i + 1][j], grid[i][j]);
  long long ans = LLONG_MAX, L, R, U, D;
  for (int u = 0; u < n - 2; u++) {
    for (int d = u + 2; d < n; d++) {
      sums.clear();
      mapping.clear();
      for (int r = 2; r < m; r++) {
        long long val1 =
            du[u][r - 2] - du[d][r - 2] - lr[u][r - 2] - rl[d][r - 2];
        sums.insert(make_pair(val1, r - 2));
        long long val = t - (lr[u][r] + ud[d][r] - ud[u][r] + rl[d][r]);
        set<pair<long long, int> >::iterator it =
            sums.lower_bound(make_pair(val, 0));
        long long d1 = abs(val - it->first);
        if (d1 <= ans) {
          ans = d1;
          L = it->second;
          U = u;
          D = d;
          R = r;
        }
        it = sums.upper_bound(make_pair(val, 0));
        if (it != sums.begin()) it--;
        d1 = abs(val - it->first);
        if (d1 <= ans) {
          ans = d1;
          L = it->second;
          U = u;
          D = d;
          R = r;
        }
      }
    }
  }
  printf("%lli %lli %lli %lli\n", U + 1, L + 1, D + 1, R + 1);
  return 0;
}
