program kp_matrix;

{$APPTYPE CONSOLE}

// Complexity O(n*m^2)
// Worst case O(maxn^3)

const
  maxn=200;

var
  n, m, i, j, k, maxs, maxb, maxres, maxlr, maxlc, maxrr, maxrc: 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;

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

  // reading and checking input

  readln(n,m);

  assert((2<=n) and (n<=maxn) and (2<=m) and (m<=maxn));

  for i:=1 to n do begin
    for j:=1 to m do begin
      read(a[i,j]);
      assert((0<=a[i,j]) and (a[i,j]<=1000000));
    end;
    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;
  for i:=1 to m-1 do
    for j:=i+1 to m do begin

      maxsum[1]:= 0; maxrow[1]:= 1;
      for k:=2 to n-1 do
        if rows[k,j-1]-rows[k,i]-(cols[i,k-1]+cols[j,k-1]+rows[1,j-1]-rows[1,i]) > maxsum[k-1] then begin
          maxsum[k]:= rows[k,j-1]-rows[k,i]-(cols[i,k-1]+cols[j,k-1]+rows[1,j-1]-rows[1,i]);
          maxrow[k]:= k;
        end else begin
          maxsum[k]:= maxsum[k-1];
          maxrow[k]:= maxrow[k-1];
        end;
        
      maxs:= maxsum[n-1]; maxb:= n;
      for k:=n-1 downto 2 do
        if rows[k,j-1]-rows[k,i]-(cols[i,n]-cols[i,k]+cols[j,n]-cols[j,k]+rows[n,j-1]-rows[n,i])+maxsum[k-1]>maxs then  begin
          maxs:= rows[k,j-1]-rows[k,i]-(cols[i,n]-cols[i,k]+cols[j,n]-cols[j,k]+rows[n,j-1]-rows[n,i])+maxsum[k-1];
          maxb:= k;
        end;
      if maxs+cols[i,n]+cols[j,n]+rows[1,j-1]-rows[1,i]+rows[n,j-1]-rows[n,i] > maxres then begin
        maxres:= maxs+cols[i,n]+cols[j,n]+rows[1,j-1]-rows[1,i]+rows[n,j-1]-rows[n,i];
        maxlr:= maxrow[maxb-1]; maxlc:= i;
        maxrr:= maxb; maxrc:= j;
      end;

    end;

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