import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

import scala.collection.mutable.ArrayBuffer

object Main {
  def main(args: Array[String]): Unit = {
    implicit val in: BufferedReader = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))

    val Array(h, w) = in.readLine.split("\\s+").map(_.toInt)
    val table = Array.fill(h) {
      in.readLine.split("\\s+").map(_.toInt)
    }

    @inline
    def cursorToXY(cursor: Int): (Int, Int) = {
      (if (cursor / w % 2 == 0) {
        cursor % w
      } else {
        w - 1 - cursor % w
      }, cursor / w)
    }

    val moves = ArrayBuffer.empty[List[Int]]

    for (cursor <- 0 until h * w - 1) {
      val (x, y) = cursorToXY(cursor)
      if (table(y)(x) % 2 == 1) {
        val (nx, ny) = cursorToXY(cursor + 1)
        moves.append(List(y, x, ny, nx))
        table(ny)(nx) += 1
      }
    }

    out.println(moves.length)
    for(move <- moves) {
      out.println(move.mkString(" "))
    }

    out.flush()
  }
}