#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MX = 500;

int h, w;
int grid[MX][MX];

int dx[4] = {0, -1, 0, 1};
int dy[4] = {-1, 0, 1, 0};

bool valid(int x, int y) {
    return (x >= 0 && x < h && y >= 0 && y < w);
}

int main() {
    cin.sync_with_stdio(0); cin.tie(0);
    cin >> h >> w;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> grid[i][j];
        }
    }
    
    vector<pair<int, int>> starts, ends;

    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (!grid[i][j]) continue;
            int fx = -1, fy = -1;
            bool set = false;
            for (int k = 0; k < 4; k++) {
                int a = i + dx[k], b = j + dy[k];
                if (!valid(a, b)) continue;
                if (grid[i][j] % 2 != grid[a][b] % 2) {
                    if (grid[i][j] % 2) fx = a, fy = b;
                } else if (grid[i][j] % 2 == 0 && grid[a][b] % 2 == 0) {
                    continue;
                } else {
                    starts.push_back({i, j});
                    ends.push_back({a, b});
                    grid[a][b]++;
                    grid[i][j]--;
                    set = true;
                    break;
                }
            }
            if (fx != -1 && !set) {
                starts.push_back({i, j});
                ends.push_back({fx, fy});
                grid[fx][fy]++;
                grid[i][j]--;
            }
        }
    }
    
    cout << starts.size() << '\n';
    for (int i = 0; i < (int)starts.size(); i++) {
        cout << starts[i].first + 1 << ' ' << starts[i].second + 1 << ' ' << ends[i].first + 1 << ' ' << ends[i].second + 1 << '\n';
    }
}


#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
//コンビネーションを10^9+7で割った余りを求める
const int MOD=1000000007;
int main(){
    int h,w;
    cin>>h>>w;
    vector<vector<int>> c(h,vector<int> (w));
    bool p=false;
    rep(i,h){
        rep(j,w){
            cin>>c[i][j];
        }
    }
    int l=0,r=0;
    int ans=0;
    string s="";
    while(1){
        
        if(c[l][r]%2!=0 && !p){
            p=true;
            if(l==h-1 && h%2==0 && r==0){}
            else if(l==h-1 && h%2==1 && r==w-1){}
            //cout<<l+1<<" "<<r+1<<" ";
            else{
                s+=to_string(l+1)+" "+to_string(r+1)+" ";
            }
        }
        else if(c[l][r]%2==0 && p){
            //cout<<l+1<<" "<<r+1<<endl;
            ans++;
            if(l==h-1 && h%2==0 && r==0 || l==h-1 && h%2==1 && r==w-1){
                s+=to_string(l+1)+" "+to_string(r+1)+"\n";
                break;
            }
            s+=to_string(l+1)+" "+to_string(r+1)+"\n";

            s+=to_string(l+1)+" "+to_string(r+1)+" ";
            //cout<<l+1<<" "<<r+1<<" ";
        }
        else if(c[l][r]%2!=0 && p){
            p=false;
            //cout<<l+1<<" "<<r+1<<endl;
            s+=to_string(l+1)+" "+to_string(r+1)+"\n";
            ans++;
        }
        else{//c[l][r]が偶数でコインを持ってない

        }
        
       //cout<<l<<" "<<r<<endl;
       if(l==h-1 && h%2==0 && r==0){
           break;
       }
       if(l==h-1 && h%2==1 && r==w-1){
           break;
       }
        if(r==w-1 && l%2==0){
            l++;
            continue;
        }
        if(r==0 && l%2==1){
            l++;
            continue;
        }
        if(l%2==0){
            r++;
        }
        else{
            r--;
        }
    }
    cout<<ans<<endl;
    cout<<s;
}