#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;
const long long INF = 1LL<<60;

int main() {
  int H,W; cin>>H>>W;
  vector<vector<int>> A(H,vector<int>(W));
  rep(i,H){
    rep(j,W){
      cin>>A.at(i).at(j);
    }
  }
  rep(i,H) if(i%2==1) reverse(A.at(i).begin(),A.at(i).end());
  
  vector<int> S;
  vector<bool> F(H*W,false);
  rep(i,H){
    rep(j,W){
      S.push_back(A.at(i).at(j)%2);
    }
  }
  int count=0,temp=0;
  rep(i,H*W-1){
    if(temp==0&&S.at(i)==1)temp++;
    else if(temp==1&&S.at(i)==1)temp--;
    
    if(temp==1){
      F.at(i)=true;
      count++;
    }
  }
  cout<<count<<endl;
  
  rep(i,H*W){
    if(F.at(i)){
      int x=i%W,y=i/W,xd,yd;
      if(y%2==0){
        if(x==W-1) xd=x,yd=y+1;
        else xd=x+1,yd=y;
      }
      else{
        x=W-x-1;
        if(x==0) xd=x,yd=y+1;
        else xd=x-1,yd=y;
      }
      cout<<y+1<<' '<<x+1<<' '<<yd+1<<' '<<xd+1<<endl;
    }
  }
}

#include <iostream>
#include <cmath>
#include <tuple>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int H, W, A[509][509];
vector<tuple<int, int, int, int>> L;

int main() {
	cin >> H >> W;
	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) cin >> A[i][j];
	}
	for (int i = 1; i <= H; i++) {
		for (int j = W - 1; j >= 1; j--) {
			if (A[i][j + 1] % 2 == 0) continue;
			L.push_back(make_tuple(i, j + 1, i, j));
			A[i][j + 1]--;
			A[i][j]++;
		}
	}
	for (int i = H - 1; i >= 1; i--) {
		if (A[i + 1][1] % 2 == 0) continue;
		L.push_back(make_tuple(i + 1, 1, i, 1));
		A[i + 1][1]--;
		A[i][1]++;
	}

	cout << L.size() << endl;
	for (int i = 0; i < L.size(); i++) cout << get<0>(L[i]) << " " << get<1>(L[i]) << " " << get<2>(L[i]) << " " << get<3>(L[i]) << endl;
	return 0;
}