#include <bits/stdc++.h>
using namespace std;
int a[300][300];
int l[300][300];
int lf[300][300];
int w[300][300];
int wf[300][300];
int main() {
  int n, m, t;
  scanf("%d%d%d", &n, &m, &t);
  int p, u, d;
  scanf("%d%d%d", &p, &u, &d);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &a[i][j]);
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < m; j++) {
      if (a[i][j] > a[i][j - 1])
        w[i][j] = w[i][j - 1] + u;
      else if (a[i][j] < a[i][j - 1])
        w[i][j] = w[i][j - 1] + d;
      else
        w[i][j] = w[i][j - 1] + p;
    }
    for (int j = m - 2; j >= 0; j--) {
      if (a[i][j] > a[i][j + 1])
        wf[i][j] = wf[i][j + 1] + u;
      else if (a[i][j] < a[i][j + 1])
        wf[i][j] = wf[i][j + 1] + d;
      else
        wf[i][j] = wf[i][j + 1] + p;
    }
  }
  for (int j = 0; j < m; j++) {
    for (int i = 1; i < n; i++) {
      if (a[i][j] > a[i - 1][j])
        l[i][j] = l[i - 1][j] + u;
      else if (a[i][j] < a[i - 1][j])
        l[i][j] = l[i - 1][j] + d;
      else
        l[i][j] = l[i - 1][j] + p;
    }
    for (int i = n - 2; i >= 0; i--) {
      if (a[i][j] > a[i + 1][j])
        lf[i][j] = lf[i + 1][j] + u;
      else if (a[i][j] < a[i + 1][j])
        lf[i][j] = lf[i + 1][j] + d;
      else
        lf[i][j] = lf[i + 1][j] + p;
    }
  }
  int ax, ay, bx, by;
  int tx, ty, px, py;
  int ans = 1999999999;
  for (ax = 0; ax < n; ax++) {
    for (ay = 0; ay < m; ay++) {
      for (bx = ax + 2; bx < n; bx++) {
        for (by = ay + 2; by < m; by++) {
          int s = w[ax][by] - w[ax][ay] + wf[bx][ay] - wf[bx][by] + l[bx][by] -
                  l[ax][by] + lf[ax][ay] - lf[bx][ay];
          s = abs(s - t);
          if (ans > s) {
            ans = s;
            tx = ax;
            ty = ay;
            px = bx;
            py = by;
          }
        }
      }
    }
  }
  printf("%d %d %d %d\n", tx + 1, ty + 1, px + 1, py + 1);
  return 0;
}
