{$A+,B-,D+,E+,F-,G-,I+,L+,N+,O-,P-,Q-,R-,S-,T-,V+,X+,Y+}
{$M 16384,0,655360}
{ 14 olimpiada, jaunesniřjř grupë, 271 uţdavinys }
{ Justo Kranausko sprendimas }
program dziungles;
  const max_plotis = 640;
        max_lango_plotis = 100;
        max_lango_aukstis = 100;
  type stulpeliai = array [1..max_lango_aukstis, 1..max_plotis] of byte;
       histograma = array [0..255] of integer;
  var f : text;
      plotis, aukstis,
      lango_plotis, lango_aukstis : integer;
      opt_x, opt_y : integer;

  {suranda optimalia vieta aikštelei, atlikdamas salygoje
   nurodytus skaiciavimus}
  procedure surask_vieta (var f : text; plotis, aukstis,
                                        lango_plotis, lango_aukstis : integer;
                                        var opt_x, opt_y : integer);
    var i, j, k : integer;

        s : stulpeliai;
        s_poz : integer;
        h : histograma;

        suma : longint;
        min, max : byte;

        koef : real;

        opt_koef : real;
  begin
    opt_koef := -1.0;
    s_poz := 1;
    for i := 1 to aukstis do
      begin
        {nuskaitome tiek eiluciu, kiek telpa i buferi}
        for j := 1 to plotis do
          read (f, s[s_poz, j]);
        s_poz := s_poz mod lango_aukstis + 1;
        if i >= lango_aukstis
          then
            begin
              suma := 0;
              fillchar (h, sizeof (h), 0);
              for j := 1 to plotis do
                begin
                  {pridedame naujas reikšmes, kurios jau ieina i aikštele,
                   paslinkus vieta aikštelei, nors anksciau nepateko}
                  for k := 1 to lango_aukstis do
                    begin
                      suma := suma + s[k, j];
                      inc (h[s[k, j]]);
                    end;
                  if j >= lango_plotis
                    then
                      begin
                        {cia jau turime mus dominancia suma ir histograma}
                        {surandame vidurki, minimuma ir maksimuma}
                        min := 0;
                        while h[min] = 0 do
                          inc (min);
                        max := 255;
                        while h[max] = 0 do
                          dec (max);
                        {tikriname, ar negavome optimalesnes vietos aikštelei}
                        koef := (min / max) * (suma / (lango_plotis * lango_aukstis));
                        if koef > opt_koef
                          then
                            begin
                              opt_koef := koef;
                              opt_x := j;
                              opt_y := i;
                            end;
                        {atimame reikšmes išeisiancias iš aikšteles ribu}
                        for k := 1 to lango_aukstis do
                          begin
                            suma := suma - s[k, j - lango_plotis + 1];
                            dec (h[s[k, j - lango_plotis + 1]]);
                          end;
                      end;
                end;
            end;
      end;
  end;

begin
  assign (f, 'dziungles.dat');
  reset (f);
  readln (f, plotis, aukstis, lango_plotis, lango_aukstis);
  surask_vieta (f, plotis, aukstis, lango_plotis, lango_aukstis, opt_x, opt_y);
  close (f);

  assign (f, 'dziungles.rez');
  rewrite (f);
  writeln (f, opt_x - lango_plotis + 1, ' ', opt_y - lango_aukstis + 1, ' ',
              opt_x, ' ', opt_y);
  close (f);
end.
