#include <bits/stdc++.h>
using namespace std;
int Map[302][302];
int td, tu, tp;
int n, m, t;
int row[302][302];
int col[302][302];
int row2[302][302];
int col2[302][302];
bool viarow[302], viaco[302];
void read() {
  scanf("%d%d%d", &n, &m, &t);
  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]);
}
int f(int x1, int y1, int x2, int y2) {
  if (Map[x1][y1] < Map[x2][y2]) return tu;
  if (Map[x1][y1] > Map[x2][y2]) return td;
  return tp;
}
void get() {
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++)
      row[j][i] = row[j - 1][i] + (j == 1 ? 0 : f(j - 1, i, j, i));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      col[i][j] = col[i][j - 1] + (j == 1 ? 0 : f(i, j - 1, i, j));
  for (int i = 1; i <= m; i++)
    for (int j = n; j >= 1; j--)
      row2[j][i] = row2[j + 1][i] + (j == n ? 0 : f(j + 1, i, j, i));
  for (int i = 1; i <= n; i++)
    for (int j = m; j >= 1; j--)
      col2[i][j] = col2[i][j + 1] + (j == m ? 0 : f(i, j + 1, i, j));
}
int ansx1, ansy1, ansx2, ansy2;
int dis = 2e9;
int getans(int x1, int y1, int x2, int y2) {
  int ret = 0;
  ret += row2[x1][y1] - row2[x2][y1];
  ret += row[x2][y2] - row[x1][y2];
  ret += col[x1][y2] - col[x1][y1];
  ret += col2[x2][y1] - col2[x2][y2];
  return abs(t - ret);
}
void ans() { printf("%d %d %d %d\n", ansx1, ansy1, ansx2, ansy2); }
int main() {
  read();
  get();
  getans(1, 1, 2, 2);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      for (int i2 = i + 2; i2 <= n; i2++)
        for (int j2 = j + 2; j2 <= m; j2++) {
          int temp = getans(i, j, i2, j2);
          if (dis > temp) {
            dis = temp;
            ansx1 = i;
            ansy1 = j;
            ansx2 = i2;
            ansy2 = j2;
            if (dis == 0) {
              ans();
              return 0;
            }
          }
        }
    }
  ans();
}
