#include <bits/stdc++.h>
using namespace std;
const int maxn = 302;
int g[maxn][maxn];
int Left[maxn][maxn][3], Right[maxn][maxn][3], Up[maxn][maxn][3],
    Down[maxn][maxn][3];
int main() {
  ios::sync_with_stdio(0);
  int n, m, t;
  int tp, tu, td;
  while (cin >> n >> m >> t >> tp >> tu >> td) {
    int ans = 999999999;
    int x1, y1, x2, y2;
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j) cin >> g[i][j];
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        for (int k = 0; k < 3; ++k) {
          Left[i][j][k] = Right[i][j][k] = Up[i][j][k] = Down[i][j][k] = 0;
        }
    for (int i = 1; i <= n; ++i) {
      for (int j = 2; j <= m; ++j) {
        Right[i][j][0] = Right[i][j - 1][0];
        Right[i][j][1] = Right[i][j - 1][1];
        Right[i][j][2] = Right[i][j - 1][2];
        if (g[i][j - 1] == g[i][j])
          ++Right[i][j][0];
        else if (g[i][j - 1] < g[i][j])
          ++Right[i][j][1];
        else
          ++Right[i][j][2];
      }
      for (int j = m - 1; j >= 1; --j) {
        Left[i][j][0] = Left[i][j + 1][0];
        Left[i][j][1] = Left[i][j + 1][1];
        Left[i][j][2] = Left[i][j + 1][2];
        if (g[i][j + 1] == g[i][j])
          ++Left[i][j][0];
        else if (g[i][j + 1] < g[i][j])
          ++Left[i][j][1];
        else
          ++Left[i][j][2];
      }
    }
    for (int j = 1; j <= m; ++j) {
      for (int i = 2; i <= n; ++i) {
        Down[i][j][0] = Down[i - 1][j][0];
        Down[i][j][1] = Down[i - 1][j][1];
        Down[i][j][2] = Down[i - 1][j][2];
        if (g[i - 1][j] == g[i][j])
          ++Down[i][j][0];
        else if (g[i - 1][j] < g[i][j])
          ++Down[i][j][1];
        else
          ++Down[i][j][2];
      }
      for (int i = n - 1; i >= 1; --i) {
        Up[i][j][0] = Up[i + 1][j][0];
        Up[i][j][1] = Up[i + 1][j][1];
        Up[i][j][2] = Up[i + 1][j][2];
        if (g[i + 1][j] == g[i][j])
          ++Up[i][j][0];
        else if (g[i + 1][j] < g[i][j])
          ++Up[i][j][1];
        else
          ++Up[i][j][2];
      }
    }
    int cp, cu, cd, tt, tx, L, R, d;
    for (int a = 1; a <= n; ++a)
      for (int b = 1; b <= m; ++b)
        for (int c = a + 2; c <= n; ++c) {
          for (L = b + 2, R = m; L + 1 < R;) {
            d = (L + R) >> 1;
            cp = Right[a][d][0] - Right[a][b][0] + Left[c][b][0] -
                 Left[c][d][0] + Up[a][b][0] - Up[c][b][0] + Down[c][d][0] -
                 Down[a][d][0];
            cu = Right[a][d][1] - Right[a][b][1] + Left[c][b][1] -
                 Left[c][d][1] + Up[a][b][1] - Up[c][b][1] + Down[c][d][1] -
                 Down[a][d][1];
            cd = Right[a][d][2] - Right[a][b][2] + Left[c][b][2] -
                 Left[c][d][2] + Up[a][b][2] - Up[c][b][2] + Down[c][d][2] -
                 Down[a][d][2];
            tt = cp * tp + cu * tu + cd * td - t;
            tx = (tt > 0 ? tt : -tt);
            if (tx < ans) {
              ans = tx;
              x1 = a;
              y1 = b;
              x2 = c;
              y2 = d;
              if (ans == 0) goto that;
            }
            if (tt > 0)
              R = d;
            else
              L = d;
          }
          for (d = L; d <= R; ++d) {
            cp = Right[a][d][0] - Right[a][b][0] + Left[c][b][0] -
                 Left[c][d][0] + Up[a][b][0] - Up[c][b][0] + Down[c][d][0] -
                 Down[a][d][0];
            cu = Right[a][d][1] - Right[a][b][1] + Left[c][b][1] -
                 Left[c][d][1] + Up[a][b][1] - Up[c][b][1] + Down[c][d][1] -
                 Down[a][d][1];
            cd = Right[a][d][2] - Right[a][b][2] + Left[c][b][2] -
                 Left[c][d][2] + Up[a][b][2] - Up[c][b][2] + Down[c][d][2] -
                 Down[a][d][2];
            tt = cp * tp + cu * tu + cd * td - t;
            tx = (tt > 0 ? tt : -tt);
            if (tx < ans) {
              ans = tx;
              x1 = a;
              y1 = b;
              x2 = c;
              y2 = d;
              if (ans == 0) goto that;
            }
          }
        }
  that:
    cout << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
  }
  return 0;
}
