
var
  W, H: Integer;
  s: array [1..1000] of String;

procedure Invert(x, y: Integer);
begin
  if s[y, x] = '+' then s[y, x] := '-' else s[y, x] := '+';
end;

function Calc(x, y: Integer): Integer;
var
  ch: Char;
begin
  Result := 0;
  ch := s[y, x];
  if x > 1 then Inc(Result, Ord(ch <> s[y, x - 1]));
  if x < W then Inc(Result, Ord(ch <> s[y, x + 1]));
  if y > 1 then Inc(Result, Ord(ch <> s[y - 1, x]));
  if y < H then Inc(Result, Ord(ch <> s[y + 1, x]));
end;

procedure FindBest(px, py: Integer; out bx, by: Integer);
var
  x, y, m, before, after: Integer;
begin
  m := -10;
  bx := 0; by := 0;
  for y := 1 to H do
    for x := 1 to W do begin
      if (x = px) and (y = py) then continue;
      before := Calc(x, y);
      Invert(x, y);
      after := Calc(x, y);
      if after - before > m then begin
        m := after - before;
        bx := x;
        by := y;
      end;
      Invert(x, y);
    end;
end;

var
  f: TextFile;
  x1, y1, x2, y2, y: Integer;
begin
  AssignFile(f, 'input.txt'); Reset(f);
  Readln(f, H, W);
  for y := 1 to H do Readln(f, s[y]);
  CloseFile(f);

  FindBest(0, 0, x1, y1);
  Invert(x1, y1);
  FindBest(x1, y1, x2, y2);

  AssignFile(f, 'output.txt'); Rewrite(f);
  Writeln(f, y1, ' ', x1, ' ', y2, ' ', x2);
  CloseFile(f);
end.
