program test
implicit none

integer :: h=0,w=0,a(500,500)=0,i=0,j=0,k=0,count=0,ans(250000,4)=0,even=0

read(*,*) h,w
do i=1,h
	read(*,*) (a(i,j),j=1,w)
enddo

do i=1,h
	if(mod(i,2)==1)then
		do j=1,w-1
			if((mod(a(i,j),2)) == 1) then
				count = count + 1
				a(i,j) = a(i,j) - 1
				a(i,j+1) = a(i,j+1) + 1
				ans(count,1) = i
				ans(count,2) = j
				ans(count,3) = i
				ans(count,4) = j+1
			endif
		enddo
		if(i<h .and. mod(a(i,w),2) == 1)then
			count = count + 1
			a(i,w) = a(i,w) - 1
			a(i+1,w) = a(i+1,w) + 1
			ans(count,1) = i
			ans(count,2) = w
			ans(count,3) = i+1
			ans(count,4) = w
		endif
	else
		do j=w,2,-1
			if((mod(a(i,j),2)) == 1)then
				count = count + 1
				a(i,j) = a(i,j) - 1
				a(i,j-1) = a(i,j-1) + 1
				ans(count,1) = i
				ans(count,2) = j
				ans(count,3) = i
				ans(count,4) = j-1
			endif
		enddo
		if(i<h .and. mod(a(i,1),2) == 1)then
			count = count + 1
			a(i,1) = a(i,1) - 1
			a(i+1,1) = a(i+1,1) + 1
			ans(count,1) = i
			ans(count,2) = 1
			ans(count,3) = i+1
			ans(count,4) = 1
		endif
	endif
enddo

write(*,*) count
do i=1,count
	write(*,*) (ans(i,j),j=1,4)
enddo

end program