//11:56 - 14:30 (с перерывом на обед ;)

{$R+,Q+}

const 
  NMAX = 200;

var
  a, r, p, ps: array [1..NMAX,1..NMAX] of integer;
  n,m,i,j,k,l: integer;
  i0,j0,i1,j1,sum,sum1,sum2: integer;

begin

  readln(n,m);
  for i:=1 to n do
    for j:=1 to m do
      read(a[i,j]);

  //суммы по строкам
  for i:=1 to n do r[i,1] := a[i,1];
  for j:=2 to m do
    for i:=1 to n do
      r[i,j]:=r[i,j-1] + a[i,j];

   sum := a[1,1]; i0:=1; j0:=1; i1:=1; j1:=1;

   k:=2;
   for i:=1 to m-1 do
     for j:=i+1 to m do
     begin
       p[i,j] := k-1;
       ps[i,j] := (r[1,j] - r[1,i] + a[1,i]) + (r[2,j] - r[2,i] + a[2,i]);
       if ps[i,j] > sum then
       begin
         sum := ps[i,j];
         j0:=i;
         j1:=j;
         i0:=p[i,j];
         i1:=k;
       end;
     end;

   for k:=3 to n do //строки матрицы
     for i:=1 to m-1 do 
       for j:=i+1 to m do
       begin
         sum1 := ps[i,j] - (r[k-1,j-1]-r[k-1,i]) + (r[k,j]-r[k,i]+a[k,i]);
         sum2 := (r[k-1,j]-r[k-1,i]+a[k-1,i]) + (r[k,j]-r[k,i]+a[k,i]);
         if sum1>sum2 then
           ps[i,j]:=sum1
         else
         begin
           ps[i,j] := sum2;
           p[i,j] := k-1;
         end;
         if ps[i,j] > sum then
         begin
           sum := ps[i,j];
           j0:=i;
           j1:=j;
           i0:=p[i,j];
           i1:=k;
         end;
       end;


   writeln(sum);
   writeln(i0,' ',j0,' ',i1,' ',j1);
end.
