import scala.collection.mutable.ListBuffer
import scala.util.Random

object Main {
    case class Move (x : Int, y : Int, x_ : Int, y_ : Int)
    def main(args: Array[String]) = {
        val sc = new java.util.Scanner(System.in)
        val h, w = sc.nextInt
        val array = Array.ofDim[Int](h, w+1)
        for (i <- 0 until h; j <- 0 to w) {
            if (j == w) 
                array(i)(j) = -1
            else 
                array(i)(j) = if (sc.nextInt % 2 == 0) 0 else 1
        }
        val ans = new ListBuffer[Move]
        for (i <- 0 until h) {
            var tmp = -1
            for (j <- 0 until w; if array(i)(j) == 1) {
                if (tmp == -1) {
                    tmp = j
                } else {
                    for (k <- tmp until j) ans += Move(i, k, i, k+1)
                    tmp = -1
                }
            }
            if (tmp != -1 && i != h - 1) {
                array(i+1)(tmp) += 1
                ans += Move(i, tmp, i+1, tmp)
            }
        }
        println(ans.size)
        for (Move(x, y, x_, y_) <- ans) println(s"${x+1} ${y+1} ${x_ +1} ${y_ +1}")
    }
}
