import java.util.Arrays
import java.util.ArrayList
import java.util.ArrayDeque

const val MOD: Long = (1e9+7).toLong()
fun Double.format(digits: Int) = String.format("%.${digits}f", this)
fun <T : Comparable<T>> Iterable<T>.argmax(): Int? = withIndex().maxBy{it.value}?.index
fun <T : Comparable<T>> Iterable<T>.argmin(): Int? = withIndex().minBy{it.value}?.index

data class Move(val y1: Int, val x1: Int, val y2: Int, val x2: Int)
fun main(args: Array<String>) {
    val reader = System.`in`.bufferedReader()
    val (h, w) = reader.readLine()!!.split(" ").map{it.toInt()}
    val a = Array(h, {reader.readLine()!!.split(" ").map{it.toInt()}.toIntArray()})

    val res = arrayListOf<Move>()
    for (row in 0..h-1) {
        if (row%2 == 0) {
            for (col in 0..w-1) {
                if (a[row][col]%2 != 0) {
                    if (col != w-1) {
                        res.add(Move(row, col, row, col+1))
                        a[row][col+1]++
                    } else if (row != h-1) {
                        res.add(Move(row, col, row+1, col))
                        a[row+1][col]++
                    }
                }
            }
        } else {
            for (col in w-1 downTo 0) {
                if (a[row][col]%2 != 0) {
                    if (col != 0) {
                        res.add(Move(row, col, row, col-1))
                        a[row][col-1]++
                    } else if (row != h-1) {
                        res.add(Move(row, col, row+1, col))
                        a[row+1][col]++
                    }
                }
            }
        }
    }

    println(res.size)
    res.forEach {
        println("${it.y1+1} ${it.x1+1} ${it.y2+1} ${it.x2+1}")
    }
}
