"use strict";
function Main(input) {
    let lines = input.split("\n");
    let cols = lines.shift().split(/\s/).map((v) => v - 0);
    let H = cols[0], W = cols[1];
    let A = [];
    for (let n = 0; n < H; n++) {
        let cols = lines.shift().split(/\s/).map((v) => v - 0);
        cols.forEach((v) => A.push(v));
    }
    const yx = (v) => `${Math.floor(v / W) + 1} ${(v % W) + 1}`;
    const wh = W * H;
    let N = 0;
    let op = "";
    for (let n = 0; n < wh; n++) {
        if (A[n] % 2) {
            if (n < wh - 1) {
                A[n] -= 1;
                A[n + 1] += 1;
                op += `\n${yx(n)} ${yx(n + 1)}`;
                N += 1;
            }
        };
    }
    console.log(N + op);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
