#include <bits/stdc++.h>
int a[310][310], q1[310][310], q2[310][310], q3[310][310], q4[310][310];
int main() {
  int n, m, t, tp, tu, td, x[2], y[2], xt[2], yt[2], d, s, min = 1000000000;
  int i, j, k, l;
  scanf("%d%d%d", &n, &m, &t);
  scanf("%d%d%d", &tp, &tu, &td);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
      if (j < 2) continue;
      if (a[i][j] == a[i][j - 1])
        q1[i][j] = q1[i][j - 1] + tp, q3[i][j] = q3[i][j - 1] + tp;
      else if (a[i][j] > a[i][j - 1])
        q1[i][j] = q1[i][j - 1] + tu, q3[i][j] = q3[i][j - 1] + td;
      else
        q1[i][j] = q1[i][j - 1] + td, q3[i][j] = q3[i][j - 1] + tu;
    }
  for (j = 1; j <= m; j++)
    for (i = 2; i <= n; i++)
      if (a[i][j] == a[i - 1][j])
        q2[i][j] = q2[i - 1][j] + tp, q4[i][j] = q4[i - 1][j] + tp;
      else if (a[i][j] > a[i - 1][j])
        q2[i][j] = q2[i - 1][j] + tu, q4[i][j] = q4[i - 1][j] + td;
      else
        q2[i][j] = q2[i - 1][j] + td, q4[i][j] = q4[i - 1][j] + tu;
  for (i = 1; i <= n - 2; i++)
    for (j = 1; j <= m - 2; j++)
      for (k = i + 2; k <= n; k++)
        for (l = j + 2; l <= m; l++) {
          d = q1[i][l] - q1[i][j] + q2[k][l] - q2[i][l] + q3[k][l] - q3[k][j] +
              q4[k][j] - q4[i][j];
          s = d > t ? d - t : t - d;
          if (s < min) x[0] = i, y[0] = j, x[1] = k, y[1] = l, min = s;
        }
  printf("%d %d %d %d\n", x[0], y[0], x[1], y[1]);
  return 0;
}
