#include<bits/stdc++.h>
#define Int long long
using namespace std;
struct t{int a,b,c,d;};

int main(){
  int h,w;
  int a[555][555];
  cin>>h>>w;
  for(int i=1;i<=h;i++)
	for(int j=1;j<=w;j++)
	  cin>>a[i][j];

  vector<t> tmp;
  
  for(int i=1;i<=h;i++){
	
	for(int j=1;j<=w-1;j++){
	  if(a[i][j]%2){
		tmp.push_back((t){i,j,i,j+1});
		a[i][j+1]++;
	  }
	}
	
	if(i==h)break;
	if(a[i][w]%2){
	  tmp.push_back((t){i,w,i+1,w});
	  a[i+1][w]++;
	}
	i++;

	for(int j=w;j>1;j--){
	  if(a[i][j]%2){
		tmp.push_back((t){i,j,i,j-1});
		a[i][j-1]++;
	  }
	}

	if(i==h)break;
	if(a[i][1]%2){
	  tmp.push_back((t){i,1,i+1,1});
	  a[i+1][1]++;
	}
	
  }
  cout<<tmp.size()<<endl;
  for(int i=0;i<tmp.size();i++){
	t k=tmp[i];
	cout<<k.a<<" "<<k.b<<" "<<k.c<<" "<<k.d<<endl;
  }
  return 0;
}
