#include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#define ios std::ios::sync_with_stdio(false);cin.tie(NULL)
#define ll long long int
#define PI acos(-1.0)
#define EPS 1e-9 //epsilon 10^-9, checking for equality 
#define pb push_back
#define fi first
#define se second
#define go(i,a,n) for(int i=a;i<n;i++)
#define og(i,a,n) for(int i=n-1;i>=a;i--)
#define rep(i,n) go(i,0,n)
#define per(i,n) og(i,0,n)
#define sz(x) (x.size())
#define isort(x) sort(x.begin(),x.end())
#define dsort(x) sort(x.rbegin(),x.rend())
#define all(x) x.begin(),x.end()
#define rall(x) (x).rbegin(),(x).rend()
#define pr(x) cout<<(x)<<endl
#define exist(e,s) ((s).find(e)!=(s).end()) //Element e in structure s
#define existstr(c,s) ((s).find(c) !=string::npos) //Character in structure
#define fo(x,s) for(auto &x:s) //for all x in structure s
typedef vector<int> vi;typedef vector<ll> vll;typedef vector< vector<int> > vvi;
typedef vector< vector<ll> > vvll;typedef pair<int,int> ii;typedef pair<int, pair<int,int> > iii;
typedef pair<ll,ll> pll;typedef vector<ii> vii;typedef vector<iii> viii;typedef map<int,int> mii;
const int inf=1e9+7; //10^9 +7
inline void rvi(vi& v, int n){int temp; go(i,0,n){cin>>temp;v.pb(temp);}}
inline void rvll(vll& v, int n){ll temp;go(i,0,n){cin>>temp;v.pb(temp);}}
inline void prvi(vi&a){go(i,0,a.size()){cout<<a[i]<<" ";}cout<<endl;}
inline void prvll(vll&a){go(i,0,a.size()){cout<<a[i]<<" ";}cout<<endl;}
inline void prmii(map<int,int>& m){for(auto x:m){cout<<x.fi<<" "<<x.se<<endl;}}
inline vll prefixsum(vi& a){vll b;b.pb(a[0]);go(i,1,a.size()){b.pb(a[i]+b[i-1]);}return b;}
inline vll suffixsum(vi& a){vll b(sz(a));b[sz(a)-1]=a[sz(a)-1];og(i,0,sz(a)-1){b[i]=a[i]+b[i+1];}return b;}
inline vll prefixsum(vll& a){vll b;b.pb(a[0]);go(i,1,a.size()){b.pb(a[i]+b[i-1]);}return b;}
inline vll suffixsum(vll& a){vll b(sz(a));b[sz(a)-1]=a[sz(a)-1];og(i,0,sz(a)-1){b[i]=a[i]+b[i+1];}return b;}
void solve();
int main(){ios;solve();return 0;}
//--------SOLVE---------------------------------------------------------------------
typedef struct ar
{
	int y,x,yd,xd;
}ar;
void solve()
{
	int h,w;cin>>h>>w;
	int m[h][w];
	rep(i,h)
	{
		rep(j,w)
		{
			cin>>m[i][j];
		}
	}
	vector<ar> a;
	bool flag=true;
	int i=0,j=0;
	vector<vi> visited(h+2,vi(w+2));
	queue<int> q;q.push(0);
	q.push(0);
	while(!q.empty())
	{
		int u = q.front();q.pop();
		int v = q.front();q.pop();
		int next1x = u+1,next1y=v;
		int next2x = u,next2y = v+1;
		visited[u][v]=1;
		if(m[u][v]&1)
		{
			if(next1x<h&&next1y<w)
			{
				m[next1x][next1y]++;
				m[u][v]--;
				ar ans;
				ans.y = u,ans.x=v,ans.yd=next1x,ans.xd=next1y;
				a.pb(ans);
			}
			else if(next2x<h&&next2y<w)
			{
				m[next2x][next2y]++;
				m[u][v]--;
				ar ans;
				ans.y = u,ans.x=v,ans.yd=next2x,ans.xd=next2y;
				a.pb(ans);
			}
		}
		if(next1x<h&&next1y<w)
			{
				if(!visited[next1x][next1y]){
				q.push(next1x);q.push(next1y);visited[next1x][next1y]=1;
				}
			}
		if(next2x<h&&next2y<w)
			{
				if(!visited[next2x][next2y]){
				q.push(next2x);q.push(next2y);visited[next2x][next2y]=1;
			}}
	}
	cout<<a.size()<<endl;
	for(auto it:a)
	{
		cout<<it.y+1<<" "<<it.x+1<<" "<<it.yd+1<<" "<<it.xd+1<<"\n";
	}
	return;
}

Measured memory_bytes: 6136