#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define LCIN(n) LL(n);cin >> (n)
#define SCIN(n) string(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<LL,LL>
#define I vector<int>
#define S set<int>
#define pb(v) push_back(v)
#define V vector
#define rt return
#define rmsame(a) sort(ALL(a)),a.erase(unique(ALL(a)), a.end())

typedef string::const_iterator State;
class PalseError {};
class Edge{
public:
    LL from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};
//スタート点,頂点数、辺を渡して、最短経路の配列を返す

int main(){
    CIN(H);CIN(W);
    vector<vector<int>> vec;
    int ans = 0;
    for(int a = 0;a < H;a++){
        I hoge;
        for(int b = 0;b < W;b++){
            CIN(c);
            if(c%2==0){
                ans++;
            }
            hoge.pb(c%2);
        }
        vec.pb(hoge);
    }
    vector<vector<int>> w = vec,hoge;
    for(int a = 0;a < H;a++){
        if(a % 2 == 0){
            for(int b = 0;b < W;b++){
                if(b == W-1 && a == H-1){
                    continue;
                }
                w.at(a).at(b)%=2;
                if(w.at(a).at(b) == 1 && b == W-1 && a != H-1){
                    //cout<<a+1<<" "<<b+1<<" "<<a+2<<" "<<b+1<<endl;
                    w.at(a).at(b)--;
                    w.at(a+1).at(b)++;
                    hoge.push_back({a+1,b+1,a+2,b+1});
                    ans++;
                    continue;
                }
                if(w.at(a).at(b) == 1){
                    //cout<< a+1<<" "<<b+1<<" "<<a<<" "<<b+2<<endl;
                    hoge.push_back({a+1,b+1,a+1,b+2});
                    w.at(a).at(b)--;
                    w.at(a).at(b+1)++;
                    ans++;
                }
            }
        }else{
            for(int b = W-1;b >= 0;b--){
                if(b == 0 && a == H-1){
                    continue;
                }
                w.at(a).at(b)%=2;
                if(w.at(a).at(b) == 1 && b == 0 && a != H-1){
                    hoge.push_back({a+1,b+1,a+2,b+1});                    ;
                    w.at(a).at(b)--;
                    w.at(a+1).at(b)++;
                    ans++;
                    continue;
                }
                if(w.at(a).at(b) == 1){
                    hoge.push_back({a+1,b+1,a+1,b});
                    w.at(a).at(b)--;
                    w.at(a).at(b-1)++;
                    ans++;
                }
            }
        }
    }
    cout<<hoge.size()<<endl;
    for(int a = 0;a < hoge.size();a++){
        cout<<hoge.at(a).at(0)<<" "<<hoge.at(a).at(1)<<" "<<hoge.at(a).at(2)<<" "<<hoge.at(a).at(3)<<endl;
    }
    return 0;
}


Measured memory_bytes: 10928