program kp_matrix_bad2;

{$APPTYPE CONSOLE}

// Time cut heuristic, should get WA

uses windows;

label fin;

const
  maxn=200;

var
  n, m, i, j, k, maxs, maxb, maxres, maxlr, maxlc, maxrr, maxrc, ii, jj: integer;
  a: array [1..maxn,1..maxn] of integer;
  cols, rows: array [1..maxn,0..maxn] of integer;
  maxsum, maxrow: array [1..maxn] of integer;
  t: cardinal;

begin
//  reset(input,'input.txt');
//  rewrite(output,'output.txt');

  // reading and checking input

  t:= gettickcount;

  readln(n,m);

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

  // solving

  fillchar(cols,sizeof(cols),0);
  fillchar(rows,sizeof(rows),0);

  for i:=1 to m do
    for j:=1 to n do inc(cols[i,j],cols[i,j-1]+a[j,i]);

  for i:=1 to n do
    for j:=1 to m do inc(rows[i,j],rows[i,j-1]+a[i,j]);

  maxres:= -1; maxlr:= 0; maxlc:= 0; maxrr:= 0; maxrc:= 0;
  for i:=1 to n do
    for j:=1 to m do
      for ii:= i+1 to n do
        for jj:= j+1 to m do begin
          if gettickcount-t>1900 then goto fin;
          if rows[i,jj]-rows[i,j-1]+rows[ii,jj]-rows[ii,j-1]+cols[j,ii-1]-cols[j,i]+cols[jj,ii-1]-cols[jj,i]>maxres then begin
            maxres:= rows[i,jj]-rows[i,j-1]+rows[ii,jj]-rows[ii,j-1]+cols[j,ii-1]-cols[j,i]+cols[jj,ii-1]-cols[jj,i];
            maxlr:= i; maxlc:= j; maxrr:= ii; maxrc:= jj;
          end;
        end;

fin:

  writeln(maxres);
  writeln(maxlr,' ',maxlc,' ',maxrr,' ',maxrc);
end.