#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+5;
 
int main()
{
	int x1[maxn],x2[maxn];
	int y1[maxn],y2[maxn]; 
	int h,w,a[550][550],i,j,n=0;
	scanf("%d%d",&h,&w);
	for(i=1;i<=h;i++){
		for(j=1;j<=w;j++)
			scanf("%d",&a[i][j]);
	}
	for(i=1;i<=h;i++){
		for(j=1;j<w;j++){
			if(a[i][j]%2==1){
			y1[n]=i;
			y2[n]=i;
			x1[n]=j;
			x2[n]=j+1;
			n++;
			a[i][j]--;
			a[i][j+1]++;
			}
		}
	}
	for(i=1;i<h;i++){
		if(a[i][w]%2==1){
			y1[n]=i;
			y2[n]=i+1;
			x1[n]=w;
			x2[n]=w;
			n++;
			a[i][w]--;
			a[i+1][w]++;
		}
	}
	printf("%d\n",n);
	for(i=0;i<n;i++)
		printf("%d %d %d %d\n",y1[i],x1[i],y2[i],x2[i]);
	return 0;
} 