#include <bits/stdc++.h>
using namespace std;
int L[310][310], R[310][310], U[310][310], D[310][310];
int h[310][310];
inline int Abs(int x) { return x > 0 ? x : -x; }
int main() {
  int n, m, s, tp, tu, td, i, j, k;
  while (~scanf("%d%d%d", &n, &m, &s)) {
    scanf("%d%d%d", &tp, &tu, &td);
    for (i = 1; i <= n; ++i) {
      for (j = 1; j <= m; ++j) {
        scanf("%d", &h[i][j]);
        if (j > 1) {
          if (h[i][j] > h[i][j - 1])
            R[i][j] = (R[i][j - 1] + tu);
          else if (h[i][j] < h[i][j - 1])
            R[i][j] = (R[i][j - 1] + td);
          else
            R[i][j] = (R[i][j - 1] + tp);
        }
      }
    }
    for (i = n; i >= 1; --i) {
      for (j = m; j >= 1; --j) {
        if (j < m) {
          if (h[i][j] > h[i][j + 1])
            L[i][j] = (L[i][j + 1] + tu);
          else if (h[i][j] < h[i][j + 1])
            L[i][j] = (L[i][j + 1] + td);
          else
            L[i][j] = (L[i][j + 1] + tp);
        }
      }
    }
    for (j = 1; j <= m; ++j) {
      for (i = 1; i <= n; ++i) {
        if (i > 1) {
          if (h[i][j] > h[i - 1][j])
            D[i][j] = (D[i - 1][j] + tu);
          else if (h[i][j] < h[i - 1][j])
            D[i][j] = (D[i - 1][j] + td);
          else
            D[i][j] = (D[i - 1][j] + tp);
        }
      }
    }
    for (j = 1; j <= m; ++j) {
      for (i = n; i >= 1; --i) {
        if (i < n) {
          if (h[i][j] > h[i + 1][j])
            U[i][j] = (U[i + 1][j] + tu);
          else if (h[i][j] < h[i + 1][j])
            U[i][j] = (U[i + 1][j] + td);
          else
            U[i][j] = (U[i + 1][j] + tp);
        }
      }
    }
    int x, y, Min = 999999999, mid, x1, y1, x2, y2;
    for (i = 1; i <= n; ++i) {
      for (j = 1; j <= m; ++j) {
        for (x = i + 2; x <= n; ++x) {
          for (y = j + 2; y <= m; ++y) {
            {
              mid = R[i][y] - R[i][j] + D[x][y] - D[i][y] + L[x][j] - L[x][y] +
                    U[i][j] - U[x][j];
              if (Abs(mid - s) < Min) {
                x1 = i;
                y1 = j;
                x2 = x;
                y2 = y;
                Min = Abs(mid - s);
              }
            }
          }
        }
      }
    }
    printf("%d %d %d %d\n", x1, y1, x2, y2);
  }
  return 0;
}
