fun main(args: Array<String>) {
    abc109d()
}

private data class Move(val fromY: Int, val fromX: Int, val toY: Int, val toX: Int) {
    override fun toString(): String {
        return "$fromY $fromX $toY $toX"
    }
}

fun abc109d() {
    val (h, w) = readLine()!!.split(' ').map { it.toInt() }
    val coins = (1..h).map { readLine()!!.split(' ').map { it.toInt() }.toIntArray() }
        .toTypedArray()

    val moves = mutableListOf<Move>()

    for (y in 0 until h) {
        for (x in 0 until w) {
            if (coins[y][x] % 2 != 0) {
                if (x + 1 < w) {
                    coins[y][x]--
                    coins[y][x + 1]++
                    moves.add(Move(y + 1, x + 1, y + 1, x + 2))
                } else if (y + 1 < h) {
                    coins[y][x]--
                    coins[y + 1][x]++
                    moves.add(Move(y + 1, x + 1, y + 2, x + 1))
                }
            }
        }
    }

    val answer = moves.size.toString() + System.lineSeparator() +
            moves.joinToString(System.lineSeparator()) { it.toString() }

    println(answer)
}
