#include <bits/stdc++.h>
using namespace std;
long long int a[305][305], col[305][305], row[305][305], rrow[305][305],
    rcol[305][305], ans = pow(10, 15);
vector<long long int> v(4);
void solve() {
  long long int n, m, t, tp, tu, td;
  cin >> n >> m >> t >> tp >> tu >> td;
  for (long long int i = 1; i <= n; i++)
    for (long long int j = 1; j <= m; j++) cin >> a[i][j];
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 2; j <= m; j++) {
      row[i][j] = row[i][j - 1];
      if (a[i][j] == a[i][j - 1])
        row[i][j] += tp;
      else if (a[i][j] > a[i][j - 1])
        row[i][j] += tu;
      else
        row[i][j] += td;
    }
    for (long long int j = m - 1; j >= 1; j--) {
      rrow[i][j] = rrow[i][j + 1];
      if (a[i][j] == a[i][j + 1])
        rrow[i][j] += tp;
      else if (a[i][j] > a[i][j + 1])
        rrow[i][j] += tu;
      else
        rrow[i][j] += td;
    }
  }
  for (long long int j = 1; j <= m; j++) {
    for (long long int i = 2; i <= n; i++) {
      col[i][j] = col[i - 1][j];
      if (a[i][j] == a[i - 1][j])
        col[i][j] += tp;
      else if (a[i][j] > a[i - 1][j])
        col[i][j] += tu;
      else
        col[i][j] += td;
    }
    for (long long int i = n - 1; i >= 1; i--) {
      rcol[i][j] = rcol[i + 1][j];
      if (a[i][j] == a[i + 1][j])
        rcol[i][j] += tp;
      else if (a[i][j] > a[i + 1][j])
        rcol[i][j] += tu;
      else
        rcol[i][j] += td;
    }
  }
  for (long long int i = 1; i <= n; i++)
    for (long long int j = i + 2; j <= n; j++) {
      multiset<pair<long long int, long long int> > s;
      for (long long int k = 2; k <= m; k++)
        s.insert({col[j][k] - col[i][k] + row[i][k] - rrow[j][k], k});
      for (long long int k = 1; k < m; k++) {
        auto it = s.find(
            {col[j][k + 1] - col[i][k + 1] + row[i][k + 1] - rrow[j][k + 1],
             k + 1});
        if (it != s.end()) s.erase(it);
        if (s.empty()) break;
        long long int val = rcol[i][k] - rcol[j][k] - row[i][k] + rrow[j][k];
        it = s.lower_bound({t - val, 0});
        if (it != s.end() && abs(val + it->first - t) < ans) {
          ans = abs(val + it->first - t);
          v[0] = i, v[1] = k, v[2] = j, v[3] = it->second;
        }
        if (it != s.begin()) {
          --it;
          if (abs(val + it->first - t) < ans) {
            ans = abs(val + it->first - t);
            v[0] = i, v[1] = k, v[2] = j, v[3] = it->second;
          }
        }
      }
    }
  for (long long int i = 0; i < 4; i++) cout << v[i] << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int qc = 1;
  for (long long int i = 1; i <= qc; i++) solve();
}
