import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, std.random, core.bitop;

enum inf = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;

alias Ope = Tuple!(int, "y1", int, "x1", int, "y2", int, "x2");

void main() {
    int H, W;
    scan(H, W);
    auto a = iota(H).map!(i => readln.split.to!(int[])).array;

    Ope[] ans;

    foreach (i ; 0 .. H) {
        if (i % 2 == 0) {
            foreach (j ; 0 .. W - 1) {
                if (a[i][j] & 1) {
                    ans ~= Ope(i, j, i, j + 1);
                    a[i][j + 1]++;
                }
            }

            if ((a[i][W - 1] & 1) && i + 1 < H) {
                ans ~= Ope(i, W - 1, i + 1, W - 1);
                a[i + 1][W - 1]++;
            }
        }
        else {
            foreach_reverse (j ; 1 .. W) {
                if (a[i][j] & 1) {
                    ans ~= Ope(i, j, i, j - 1);
                    a[i][j - 1]++;
                }
            }
            if ((a[i][0] & 1) && i + 1 < H) {
                ans ~= Ope(i, 0, i + 1, 0);
                a[i + 1][0]++;
            }
        }
    }

    writeln(ans.length);
    ans.each!(ansi => writefln("%s %s %s %s", ansi.y1 + 1, ansi.x1 + 1, ansi.y2 + 1, ansi.x2 + 1));
}





void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}
