import std.stdio;
import std.ascii;
import std.conv;
import std.string;
import std.algorithm;
import std.range;
import std.functional;
import std.math;
import core.bitop;
import std.numeric;

alias lread = () => readln.chomp.to!long;
alias aryread = () => readln.split.to!(long[]);

void main()
{
    auto hw = aryread();
    long H = hw[0];
    long W = hw[1];
    auto a = new long[][](H, W);
    long[] queue;

    foreach (i; 0 .. H)
    {
        a[i][] = aryread().array();
    }

    long[][] result;

    foreach (y; 0 .. H)
        foreach (x; 0 .. W)
        {
            if (a[y][x] % 2 != 0)
            {
                if (y == H - 1 && x == W - 1)
                {
                    continue;
                }
                else if (y == H - 1)
                {
                    a[y][x]--;
                    a[y][x + 1]++;
                    result ~= [y + 1, x + 1, y + 1, x + 2];
                }
                else
                {
                    a[y][x]--;
                    a[y + 1][x]++;
                    result ~= [y + 1, x + 1, y + 2, x + 1];
                }
            }
        }
    result.length.writeln;
    foreach (r; result)
        "%d %d %d %d".writefln(r[0], r[1], r[2], r[3]);
}
