import java.util.Scanner

import scala.annotation.tailrec

object Main extends App {
  val sc = new Scanner(System.in)
  val H, W = sc.nextInt
  val as = Vector.fill(H, W)(sc.nextInt)

  @tailrec private def loop(pos: (Int, Int), prev: Int, acc: Seq[(Int, Int, Int, Int)]): Seq[(Int, Int, Int, Int)] = {
    val (i, j) = pos
    val next = nextOf(pos)
    if (i == H) {
      if (prev == 0)
        acc
      else
        acc.tail
    } else {
      if ((prev + as(i)(j)) % 2 == 0) {
        loop(next, 0, acc)
      } else {
        loop(next, 1, (i, j, next._1, next._2) +: acc)
      }

    }
  }

  private def nextOf(pos: (Int, Int)): (Int, Int) = pos match {
    case (i, j) if i % 2 == 0 && j + 1 < W => (i, j + 1)
    case (i, j) if i % 2 == 0 => (i + 1, j)
    case (i, j) if j == 0 => (i + 1, j)
    case (i, j) => (i, j - 1)
  }

  val ans = loop((0, 0), 0, Seq.empty).reverse
    println(ans.size)
    ans.foreach(a => println(s"${a._1 + 1} ${a._2 + 1} ${a._3 + 1} ${a._4 + 1}"))
}
