import java.util.*

fun calcY(i: Int, j: Int, w: Int) = if (i % 2 == 0) {
    j
} else {
    w - j - 1
}

fun main(args: Array<String>) {
    var n = 0
    val y = mutableListOf<Int>()
    val x = mutableListOf<Int>()
    val yp = mutableListOf<Int>()
    val xp = mutableListOf<Int>()

    Scanner(System.`in`).use {
        val h = it.nextInt()
        val w = it.nextInt()
        val a = mutableListOf<MutableList<Int>>()

        for (i in 0 until h) {
            val ai = mutableListOf<Int>()

            for (j in 0 until w) {
                ai.add(it.nextInt())
            }

            a.add(ai)
        }

        for (i in 0 until h) {
            for (j in 0 until w) {
                val k = calcY(i, j, w)
                if (a[i][k] % 2 != 0) {
                    val kp = calcY(i, j + 1, w)
                    if ((-1 < kp && kp < w) || i + 1 < h) {
                        n++
                        a[i][k]--
                        y.add(i + 1)
                        x.add(k + 1)
                        if (-1 < kp && kp < w) {
                            a[i][kp]++
                            yp.add(i + 1)
                            xp.add(kp + 1)
                        } else {
                            a[i + 1][k]++
                            yp.add(i + 2)
                            xp.add(k + 1)
                        }
                    }
                }
            }
        }
    }

    println(n)

    for (i in 0 until n) {
        println(listOf(y[i], x[i], yp[i], xp[i]).joinToString(" "))
    }
}
