#include <bits/stdc++.h>
using namespace std;
void _fill_int(int* p, int val, int rep) {
  int i;
  for (i = 0; i < rep; i++) p[i] = val;
}
signed long long GETi() {
  signed long long i;
  scanf("%lld", &i);
  return i;
}
int H, W, T;
int P, U, D;
int V[301][301];
int ML[301][301], MR[301][301], MU[301][301], MD[301][301];
void solve() {
  int f, i, j, k, l;
  int x, y, x1, x2, y1, y2;
  int best = 1 << 30;
  int bx1, bx2, by1, by2;
  cin >> H >> W >> T;
  cin >> P >> U >> D;
  for (y = 0; y < H; y++)
    for (x = 0; x < W; x++) cin >> V[y][x];
  for (y = 0; y < H; y++) {
    for (x = 1; x < W; x++) {
      if (V[y][x] < V[y][x - 1]) MR[y][x] = MR[y][x - 1] + D;
      if (V[y][x] == V[y][x - 1]) MR[y][x] = MR[y][x - 1] + P;
      if (V[y][x] > V[y][x - 1]) MR[y][x] = MR[y][x - 1] + U;
    }
    for (x = W - 2; x >= 0; x--) {
      if (V[y][x] < V[y][x + 1]) ML[y][x] = ML[y][x + 1] + D;
      if (V[y][x] == V[y][x + 1]) ML[y][x] = ML[y][x + 1] + P;
      if (V[y][x] > V[y][x + 1]) ML[y][x] = ML[y][x + 1] + U;
    }
  }
  for (x = 0; x < W; x++) {
    for (y = 1; y < H; y++) {
      if (V[y][x] < V[y - 1][x]) MD[y][x] = MD[y - 1][x] + D;
      if (V[y][x] == V[y - 1][x]) MD[y][x] = MD[y - 1][x] + P;
      if (V[y][x] > V[y - 1][x]) MD[y][x] = MD[y - 1][x] + U;
    }
    for (y = H - 2; y >= 0; y--) {
      if (V[y][x] < V[y + 1][x]) MU[y][x] = MU[y + 1][x] + D;
      if (V[y][x] == V[y + 1][x]) MU[y][x] = MU[y + 1][x] + P;
      if (V[y][x] > V[y + 1][x]) MU[y][x] = MU[y + 1][x] + U;
    }
  }
  for (y1 = 0; y1 < H - 2; y1++)
    for (y2 = y1 + 2; y2 < H; y2++)
      for (x1 = 0; x1 < W - 2; x1++)
        for (x2 = x1 + 2; x2 < W; x2++) {
          int sc = (MR[y1][x2] - MR[y1][x1]) + (MD[y2][x2] - MD[y1][x2]) +
                   (ML[y2][x1] - ML[y2][x2]) + (MU[y1][x1] - MU[y2][x1]);
          if (abs(sc - T) < best)
            best = abs(sc - T), bx1 = x1, bx2 = x2, by1 = y1, by2 = y2;
        }
  (void)printf("%d %d %d %d\n", by1 + 1, bx1 + 1, by2 + 1, bx2 + 1);
}
int main(int argc, char** argv) {
  string s;
  if (argc == 1) ios::sync_with_stdio(false);
  for (int i = 1; i < argc; i++) s += argv[i], s += '\n';
  for (int i = s.size() - 1; i >= 0; i--) ungetc(s[i], stdin);
  solve();
  return 0;
}
