# include "iostream"
# include "cstdio"

const int maxm=5e2+10;

using namespace std;

int map[maxm][maxm],H,W;

struct step{
	int x1,y1;
	int x2,y2;
}Step[maxm*maxm];
 
int main(){
	int now; 
	register int i,j,tot=0;
	scanf("%d%d",&H,&W);
	for(i=1;i<=H;i++){
		for(j=1;j<=W;j++){
			scanf("%d",&now);
			map[i][j]+=now; 
			if(j<W && map[i][j]%2==1){
				map[i][j]--; 
				map[i][j+1]++;
				Step[++tot]=(step){i,j,i,j+1};
			}
			if(j==W && i<H && map[i][j]%2==1){
				map[i][j]--; 
				map[i+1][j]++;
				Step[++tot]=(step){i,j,i+1,j};
			}
		}
	}
	printf("%d\n",tot);
	for(i=1;i<=tot;i++){
		printf("%d %d %d %d\n",Step[i].x1,Step[i].y1,Step[i].x2,Step[i].y2); 
	}
	return 0; 
}