#include <bits/stdc++.h>
int right[301][301];
int left[301][301];
int down[301][301];
int up[301][301];
int map[301][301];
int tu, tp, td;
int abs(int x) {
  if (x > 0) return x;
  return -x;
}
inline int check(int a, int b) {
  if (a > b) return tu;
  return a < b ? td : tp;
}
int main() {
  int n, m, t;
  int x1, y1, x2, y2;
  while (~scanf("%d%d%d", &n, &m, &t)) {
    int min = 2000000000;
    scanf("%d%d%d", &tp, &tu, &td);
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        scanf("%d", &map[i][j]);
      }
    }
    for (int i = 1; i <= n; i++) {
      right[i][1] = 0;
      for (int j = 2; j <= m; j++) {
        right[i][j] = right[i][j - 1] + check(map[i][j], map[i][j - 1]);
      }
    }
    for (int i = 1; i <= n; i++) {
      left[i][m] = 0;
      for (int j = m - 1; j >= 1; j--) {
        left[i][j] = left[i][j + 1] + check(map[i][j], map[i][j + 1]);
      }
    }
    for (int i = 1; i <= m; i++) {
      down[1][i] = 0;
      for (int j = 2; j <= n; j++) {
        down[j][i] = down[j - 1][i] + check(map[j][i], map[j - 1][i]);
      }
    }
    for (int i = 1; i <= m; i++) {
      up[n][i] = 0;
      for (int j = n - 1; j >= 1; j--) {
        up[j][i] = up[j + 1][i] + check(map[j][i], map[j + 1][i]);
      }
    }
    for (int i = 1; i <= n - 1 && min; i++) {
      for (int j = 1; j <= m - 1 && min; j++) {
        for (int k = i + 2; k <= n && min; k++) {
          for (int l = j + 2; l <= m && min; l++) {
            int tmp = right[i][l] - right[i][j] + left[k][j] - left[k][l] +
                      up[i][j] - up[k][j] + down[k][l] - down[i][l];
            tmp = abs(tmp - t);
            if (min > tmp) {
              min = tmp;
              x1 = i;
              y1 = j;
              x2 = k;
              y2 = l;
            }
          }
        }
      }
    }
    printf("%d %d %d %d\n", x1, y1, x2, y2);
  }
  return 0;
}
