import scala.collection.mutable.ListBuffer

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) array(i)(w) = tmp
        }
        var tmp = (-1, -1)
        for (i <- 0 until h; if array(i)(w) != -1) {
            if (tmp == (-1, -1)) {
                tmp = (i, array(i)(w))
            } else {
                val jj = array(i)(w)
                if (tmp._2 > jj) { // jj --> tmp._2
                    for (j <- jj until tmp._2) ans += Move(i, j, i, j+1)
                    for (ii <- tmp._1 until i) ans += Move (ii, tmp._2, ii+1, tmp._2)
                } else { // tmp._2 --> jj
                    for (j <- tmp._2 until jj) ans += Move(tmp._1, j, tmp._1, j+1)
                    for (ii <- tmp._1 until i) ans += Move (ii, jj, ii+1, jj)
                }
                tmp = (-1, -1)
            }
        }
        println(ans.size)
        for (Move(x, y, x_, y_) <- ans) println(s"${x+1} ${y+1} ${x_ +1} ${y_ +1}")
    }
}
