let (h, w) = Scanf.scanf "%d %d" (fun x y -> (x, y)) in
let a = Array.make h (Array.make w 0) in
for i = 0 to h - 1 do
  for j = 0 to w - 1 do
    a.(i).(j) <- Scanf.scanf (if j = 0 then "\n%d" else " %d") (fun x -> x)
  done
done;
let ans = ref [] in
for i = 0 to h - 2 do
  for j = 0 to w - 1 do
    if a.(i).(j) mod 2 = 1 then begin
      a.(i).(j) <- a.(i).(j) - 1;
      a.(i + 1).(j) <- a.(i + 1).(j) + 1;
      ans := (i, j, i + 1, j)::!ans
    end
  done
done;
for j = 0 to w - 2 do
  if a.(h - 1).(j) mod 2 = 1 then begin
    a.(h - 1).(j) <- a.(h - 1).(j) - 1;
    a.(h - 1).(j + 1) <- a.(h - 1).(j + 1) + 1;
    ans := (h - 1, j, h - 1, j + 1)::!ans
  end
done;
let ans = List.rev !ans in
print_int (List.length ans);
print_newline ();
ans |> List.iter (fun (y1, x1, y2, x2) -> Printf.printf "%d %d %d %d\n" (y1 + 1) (x1 + 1) (y2 + 1) (x2 + 1));;

