import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto hw = readints;
    int h = hw[0], w = hw[1];

    auto g = new int[][](h, w);
    for (int i = 0; i < h; i++) {
        g[i][] = readints;
    }

    int[][] ans;
    for (int r = 0; r < h; r++) {
        for (int c = 0; c < w; c++) {
            if (g[r][c] % 2 == 1) {
                if (c + 1 < w) {
                    g[r][c]--;
                    g[r][c+1]++;
                    ans ~= [r, c, r, c + 1];
                }
                else if (r + 1 < h) {
                    g[r][c]--;
                    g[r+1][c]++;
                    ans ~= [r, c, r + 1, c];
                }
            }
        }
    }

    writeln(ans.length);
    foreach (a; ans) {
        writeln(a.map!(e => (e + 1).to!string).join(" "));
    }
}
