program make_them_even
  implicit none
  integer :: h, w, a(500,500) = -1, i, j, l, r, s, m = 0
  integer, dimension(250000) :: x1 = 0, y1 = 0, x2 = 0, y2 = 0
  read(*,*) h, w
  do i = 1, h
    read(*,*) a(i,1:w)
  end do
  l = 1
  r = w
  s = 1
  do i = 1, h
    do j = l, r, s
      if (mod(a(i,j),2) == 0) cycle
      if (j == r .and. i /= h) then
        m = m+1
        x1(m) = i
        y1(m) = j
        x2(m) = i+1
        y2(m) = j
        a(i,j) = a(i,j)-1
        a(i+1,j) = a(i+1,j)+1
      else if (j /= r) then
        m = m+1
        x1(m) = i
        y1(m) = j
        x2(m) = i
        y2(m) = j+s
        a(i,j) = a(i,j)-1
        a(i,j+s) = a(i,j+s)+1
      end if
    end do
    l = w+1-l
    r = w+1-r
    s = -s
  end do
  write(*,'(i0)') m
  do i = 1, m
    write(*,'(i0,x,i0,x,i0,x,i0)') x1(i), y1(i), x2(i), y2(i)
  end do
end program make_them_even