#include <bits/stdc++.h>
using namespace std;
const int N = 302;
int n, m, T, tp, tu, td;
int mp[N][N];
int up[N][N], down[N][N], l[N][N], r[N][N];
void init() {
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j <= m; j++) {
      up[i][j] = up[i][j - 1];
      if (mp[i][j - 1] > mp[i][j])
        up[i][j] += td;
      else if (mp[i][j - 1] < mp[i][j])
        up[i][j] += tu;
      else
        up[i][j] += tp;
    }
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      r[i][j] = r[i - 1][j];
      if (mp[i - 1][j] > mp[i][j])
        r[i][j] += td;
      else if (mp[i - 1][j] < mp[i][j])
        r[i][j] += tu;
      else
        r[i][j] += tp;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = m - 1; j >= 1; j--) {
      down[i][j] = down[i][j + 1];
      if (mp[i][j + 1] > mp[i][j])
        down[i][j] += td;
      else if (mp[i][j + 1] < mp[i][j])
        down[i][j] += tu;
      else
        down[i][j] += tp;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 1; j <= m; j++) {
      l[i][j] = l[i + 1][j];
      if (mp[i + 1][j] > mp[i][j])
        l[i][j] += td;
      else if (mp[i + 1][j] < mp[i][j])
        l[i][j] += tu;
      else
        l[i][j] += tp;
    }
  }
}
int ans, x1, y11, x2, y2;
void solve(int x, int y) {
  for (int i = 1; i <= m; i++) {
    int flag = 1, rt = i + 2;
    while (flag) {
      if (rt > m) break;
      int val = -T;
      val += up[x][rt] - up[x][i];
      val += r[y][rt] - r[x][rt];
      val += down[y][i] - down[y][rt];
      val += l[x][i] - l[y][i];
      if (val < 0)
        val = -val;
      else
        flag = 0;
      if (val <= ans) {
        ans = val;
        x1 = x;
        y11 = i;
        x2 = y;
        y2 = rt;
      }
      rt++;
    }
  }
  return;
}
int main() {
  std::cin >> n >> m >> T;
  std::cin >> tp >> tu >> td;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) scanf("%d", &mp[i][j]);
  }
  init();
  ans = 1e9;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 2; j <= n; j++) {
      solve(i, j);
      if (ans == 0) {
        goto out;
      }
    }
  }
out:;
  printf("%d %d %d %d\n", x1, y11, x2, y2);
  return 0;
}
