program klaidos;



var
  f : text;
  lent : array[1..101, 1..101] of integer;
  n, m, i, j : integer;
  sum : integer;
  mistake : boolean;
  mn, mm : integer;


procedure lfm;
var
  i, j, sm : integer;

begin
  for i := 1 to n - 1 do
  begin
    sm := 0;
    for j := 1 to m - 1 do inc(sm, lent[i, j]);
    if sm <> lent[i, m] then
    begin
      mistake := true;
      mn := i;
    end;
  end;
  if mistake then
  for j := 1 to m - 1 do
  begin
    sm := 0;
    for i := 1 to n - 1 do inc(sm, lent[i, j]);
    if sm <> lent[n, j] then
    begin
      mm := j;
    end;
  end;

end;

begin
  assign(f, 'KLAIDOS.IN');
  reset(f);
  readln(f, n, m);
  for i := 1 to n do
  begin
    for j := 1 to m do
    begin
      read(f, lent[i, j]);    
    end;
    readln(f);
  end;
  close(f);

  mistake := false;

  lfm;

  assign(f, 'KLAIDOS.OUT');  
  rewrite(f);
  if not mistake then write(f, 0)
  else
  begin
    writeln(f, 1);
    write(f, mn,' ',mm);
  end;  
  close(f);


end.
