//11:56 - 12:35

{$R+,Q+}

const 
  NMAX = 200;

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

begin

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

  //суммы по столбцам
  for j:=1 to m do c[1,j] := a[1,j];
  for i:=2 to n do
    for j:=1 to m do
      c[i,j] := c[i-1,j] + 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];

  //простой цикл
  i0:=1; j0:=1; i1:=1; j1:=1; sum := 0;
  for i:=1 to n do
    for j:=1 to m do
      for k:=i to n do
        for l:=j to m do
        begin
          if i=k then cursum := r[i,l] - r[i,j] + a[i,j] else
          if j=l then cursum := c[k,j] - c [i,j] + a[i,j] else
          cursum := r[i,l] - r[i,j] + r[k,l] - r [k,j] + c[k,j] - c [i,j] + a[i,j] + c[k,l] - c[i,l] - a[k,l];
          if cursum > sum then 
          begin
            sum := cursum;
            i0 := i; j0 := j; i1 := k; j1 := l
          end;
        end;

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

end.
