var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split('\n');
	var temp = toIntArr(input[0].split(' '));
	var h = temp[0];
	var w = temp[1];
	var as = [];
	for(var i = 0; i < h; i++){
		as[i] = toIntArr(input[i+1].split(' ')).map(e=>e%2===0?0:1);
	}

	var n = 0;
	var ans = [];
	var flag = false;
	var m = 0;
	for(var i = 0; i < h; i++){
		if(i%2===0){
			for(var j = 0; j < w; j++){
				if(as[i][j]===1){
					if(flag){
						flag = false;
						m = n;
				}else{
						flag = true;
					}
				}
				if(flag){
						n++;
						if(j===w-1){
							ans.push([i+1,j+1,i+2,j+1]);
						}else{
							ans.push([i+1,j+1,i+1,j+2]);
						}
				}
			}
		}else{
			for(var j = w-1; j > -1; j--){
				if(as[i][j]===1){
					if(flag){
						flag = false;
						m = n;
					}else{
						flag = true;
					}
				}
				if(flag){
						n++;
						if(j===0){
							ans.push([i+1,j+1,i+2,j+1]);
						}else{
							ans.push([i+1,j+1,i+1,j]);
						}
				}
			}
		}
	}

	console.log(m);
	for(var i = 0; i < m; i++){
		console.log(ans[i][0],ans[i][1],ans[i][2],ans[i][3]);
	}
}