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

void main() {
	auto data = readln.split, H = data[0].to!uint, W = data[1].to!uint;
	uint[501][501] coin;
	foreach (i; 0 .. H) foreach (j, a; readln.split.to!(uint[])) {
		coin[i][j] = a;
	}
	
	alias Point = Tuple!(int, "x", int, "y");
	Point[501*501] p;
	int dy = 1;
	uint y;
	foreach (x; 0 .. H) {
		foreach(i; 0 .. W)
			p[x*W + i] = Point(x, y), y += dy;
		y -= dy;
		dy = -dy;
	}
	
	Tuple!(Point, Point)[] points;
	foreach (i; 0 .. H*W-1) {
		if (coin[p[i].x][p[i].y] % 2 == 1) {
			points ~= tuple(p[i], p[i+1]);
			coin[p[i].x][p[i].y]--, coin[p[i+1].x][p[i+1].y]++;
		}
	}
	writeln(points.length);
	foreach (a; points) {
		writeln(a[0].x+1, " ", a[0].y+1, " ", a[1].x+1, " ", a[1].y+1 );
	}
}