import java.io.PrintWriter
import java.util.Scanner

import scala.annotation.tailrec

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)

    val h, w = sc.nextInt()
    val vec = Array.fill(h, w)(sc.nextInt())
    val pw = new PrintWriter(System.out)

    var count = 0
    var isGoingRight = true
    for (i <- 0 until h) {
      if (!isGoingRight) {
        for (j <- w - 1 to 0 by -1) {
          if (vec(i)(j) % 2 != 0) {
            if (vec(i).lift(j - 1).isDefined) {
              vec(i)(j) -= 1
              vec(i)(j - 1) += 1
              pw.println(s"${i + 1} ${j + 1} ${i + 1} $j")
              count += 1
            } else if (vec.lift(i + 1).isDefined) {
              vec(i)(j) -= 1
              vec(i + 1)(j) += 1
              pw.println(s"${i + 1} ${j + 1} ${i + 2} ${j + 1}")
              count += 1
            }
          }
        }
        isGoingRight = !isGoingRight
      } else {
        for (j <- 0 until w) {
          if (vec(i)(j) % 2 != 0) {
            if (vec(i).lift(j + 1).isDefined) {
              vec(i)(j) -= 1
              vec(i)(j + 1) += 1
              pw.println(s"${i + 1} ${j + 1} ${i + 1} ${j + 2}")
              count += 1
            } else if (vec.lift(i + 1).isDefined) {
              vec(i)(j) -= 1
              vec(i + 1)(j) += 1
              pw.println(s"${i + 1} ${j + 1} ${i + 2} ${j + 1}")
              count += 1
            }
          }
        }
        isGoingRight = !isGoingRight
      }
    }
    println(count)
    pw.flush()

  }

  //region

  def debug(args: Any*): Unit = {
    Console.err.println(args.mkString(" "))
    Console.err.flush()
  }

  def printExecTime(process: => Unit): Unit = {
    val start = System.currentTimeMillis
    process
    debug("処理時間： " + (System.currentTimeMillis - start) + " ミリ秒")
  }

  def bitSearch[T](n: Int, choice: Vector[T]): Vector[Vector[T]] = {
    @tailrec
    def bitSearchLogic(n: Int,
                       choice: Vector[T],
                       acc: Vector[Vector[T]]): Vector[Vector[T]] = {
      if (n == 0) acc
      else {
        val newAcc =
          acc.flatMap(vec => {
            choice.map(c => vec :+ c)
          })
        bitSearchLogic(n - 1, choice, newAcc)
      }
    }

    val firstAcc = choice.map(i => Vector(i))
    bitSearchLogic(n - 1, choice, firstAcc)
  }
  //endregion
}
