{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf
import Debug.Trace

import Control.Monad.ST
import Data.Array.ST.Safe
import Data.STRef

readInt = ( readLn :: IO Int )
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readNInts = readInt >>= flip replicateM readInt

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	[ h, w ] <- readInts
	board <- replicateM h readInts
	let	
		res = solve h w board
	print $ length res
	mapM_ putStrLn $ map ( unwords . map ( show . succ ) ) res

solve h w board' = runST $ do
	board <- newListArray ( ( 0, 0 ), ( h - 1, w - 1 ) ) $ concat board' :: ST s ( STUArray s ( ( Int, Int ) ) Int )
	res <- newSTRef []
	forM_ [ 0 .. h - 1 ] $ \i -> do
		forM_ [ 0 .. w - 2 ] $ \j -> do
			v <- readArray board ( i, j )
			when ( odd v ) $ do
				nv <- succ <$> readArray board ( ( i, j + 1 ) )
				writeArray board ( i, j + 1 ) nv
				modifySTRef res ( [ i, j, i, j + 1 ] : )
		v <- readArray board ( i, w - 1 )
		when ( i + 1 < h && odd v ) $ do
			nv <- succ <$> readArray board ( ( i + 1, w - 1 ) )
			writeArray board ( i + 1, w - 1 ) nv
			modifySTRef res ( [ i, w - 1, i + 1, w - 1 ] : )
	modifySTRef res reverse
	readSTRef res