// D - Make Them Even
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
#define rpz(i,e) rp(i,0,e)
using I4 = tuple<int,int,int,int>;
using VI4 = vector<I4>;

int main(){
	int H,W; cin>>H>>W;
	vi A(W);
	VI4 YX;
	int a;
	rpz(h, H) rpz(w, W){
		cin>>a;
		A[w]^=a&1;
		if(h+1<H && A[w]) YX.emplace_back(h+1,w+1,h+1+1,w+1);
	}
	a = 0;
	rpz(w, W) if(w+1<W && (a^=A[w])) YX.emplace_back(H,w+1,H,w+1+1);
	cout<< YX.size() <<endl;
	for(auto t:YX){
		int a,b,c,d; tie(a,b,c,d) = t;
		printf("%d %d %d %d\n",a,b,c,d);
	}
}