//
// Written by Fyodor Menshikov 21.02.2006
// 10:06-10:24
//
var
   nRows,nCols,i,j,i1,j1,i2,j2,sum,bestsum,besti1,besti2,bestj1,bestj2:integer;
   a:array[1..200,1..200]of integer;
   row_sum:array[1..200,0..200]of integer;
   col_sum:array[0..200,1..200]of integer;
begin
//   assign(input,'input.txt');
   reset(input);
//   assign(output,'output.txt');
   rewrite(output);
   readln(nRows,nCols);
   for i:=1 to nRows do begin
      row_sum[i,0]:=0;
   end;
   for j:=1 to nCols do begin
      col_sum[0,j]:=0;
   end;
   for i:=1 to nRows do begin
      for j:=1 to nCols do begin
         read(a[i,j]);
         row_sum[i,j]:=row_sum[i,j-1]+a[i,j];
         col_sum[i,j]:=col_sum[i-1,j]+a[i,j];
      end;
      readln;
   end;
   bestsum:=-1;
   besti1:=0;
   besti2:=0;
   bestj1:=0;
   bestj2:=0;
   for i1:=1 to nRows do begin
      for i2:=i1 to nRows do begin
         for j1:=1 to nCols do begin
            for j2:=j1 to nCols do begin
               if (i1=i2) and (j1=j2) then begin
                  sum:=a[i1,j1];
               end
               else if i1=i2 then begin
                  sum:=row_sum[i1,j2]-row_sum[i1,j1-1];
               end
               else if j1=j2 then begin
                  sum:=col_sum[i2,j1]-col_sum[i1-1,j1];
               end
               else begin
                  sum:=
                     row_sum[i1,j2]-row_sum[i1,j1-1]+
                     row_sum[i2,j2]-row_sum[i2,j1-1]+
                     col_sum[i2,j1]-col_sum[i1-1,j1]+
                     col_sum[i2,j2]-col_sum[i1-1,j2]
                     -a[i1,j1]-a[i1,j2]-a[i2,j1]-a[i2,j2];
               end;
               if sum>bestsum then begin
                  besti1:=i1;
                  besti2:=i2;
                  bestj1:=j1;
                  bestj2:=j2;
                  bestsum:=sum;
               end;
            end;
         end;
      end;
   end;
   writeln(bestsum);
   writeln(besti1,' ',bestj1,' ',besti2,' ',bestj2);
end.