#include <bits/stdc++.h>
using namespace std;
const int maxn = 300 + 10;
int h[maxn][maxn];
int dp1[maxn][maxn], dp2[maxn][maxn], dp3[maxn][maxn], dp4[maxn][maxn];
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 = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &h[i][j]);
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j <= m; j++) {
      if (h[i][j] == h[i][j - 1]) {
        dp1[i][j] += dp1[i][j - 1] + p;
      } else if (h[i][j] > h[i][j - 1]) {
        dp1[i][j] += dp1[i][j - 1] + u;
      } else {
        dp1[i][j] += dp1[i][j - 1] + d;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = m - 1; j >= 1; j--) {
      if (h[i][j] == h[i][j + 1]) {
        dp2[i][j] += dp2[i][j + 1] + p;
      } else if (h[i][j] > h[i][j + 1]) {
        dp2[i][j] += dp2[i][j + 1] + u;
      } else {
        dp2[i][j] += dp2[i][j + 1] + d;
      }
    }
  }
  for (int j = 1; j <= m; j++) {
    for (int i = 2; i <= n; i++) {
      if (h[i][j] == h[i - 1][j]) {
        dp3[i][j] += dp3[i - 1][j] + p;
      } else if (h[i][j] > h[i - 1][j]) {
        dp3[i][j] += dp3[i - 1][j] + u;
      } else {
        dp3[i][j] += dp3[i - 1][j] + d;
      }
    }
  }
  for (int j = 1; j <= m; j++) {
    for (int i = n - 1; i >= 1; i--) {
      if (h[i][j] == h[i + 1][j]) {
        dp4[i][j] += dp4[i + 1][j] + p;
      } else if (h[i][j] > h[i + 1][j]) {
        dp4[i][j] += dp4[i + 1][j] + u;
      } else {
        dp4[i][j] += dp4[i + 1][j] + d;
      }
    }
  }
  int Min = 1e9 + 7;
  int a1, b1, a2, b2;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int k = i + 2; k <= n; k++) {
        for (int l = j + 2; l <= m; l++) {
          int sum = dp1[i][l] - dp1[i][j] + dp2[k][j] - dp2[k][l] + dp3[k][l] -
                    dp3[i][l] + dp4[i][j] - dp4[k][j];
          if (abs(sum - t) < Min) {
            Min = abs(sum - t);
            a1 = i;
            a2 = k;
            b1 = j;
            b2 = l;
          }
        }
      }
    }
  }
  printf("%d %d %d %d", a1, b1, a2, b2);
}
