#include <bits/stdc++.h>

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;


long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x[ohara],y[ohara],xx[ohara],yy[ohara],sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz");
char s[501][501];
bool fl,even;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

int main(void){
       cin.tie(0);
    ios::sync_with_stdio(false);

      
      cin>>h>>w;
      rep(i,h){
        rep(j,w){
          cin>>s[i][j];
        }
      }
      rep(i,h){
        fl=false;
        even=false;
        rep(j,w){
          if((s[i][j]-'0')%2!=0)even=true;
          if(!even)continue;
          if(!fl){
            if(j==w-1)continue;
            y[cnt]=i+1;x[cnt]=j+1;
          if(s[i][j]=='0'){
            yy[cnt]=i+1;xx[cnt]=j+2;
            cnt++;
          }
          else{
          fl=true;
          }
          continue;
          }
          if((s[i][j]-'0')%2!=0){
            even=false;
            fl=false;
            yy[cnt]=i+1;
            xx[cnt]=j+1;
            cnt++;
           if(j+1==w){
             s[i][j]++;
           }
          }
          else{
            yy[cnt]=i+1;xx[cnt]=j+1;
            cnt++;
            if(j!=w-1){
              y[cnt]=i+1;x[cnt]=j+1;
            }
            else s[i][j]++;
          }
        }
      }

      ll j=w-1;
      fl=false;
      even=false;
         rep(i,h){
          if((s[i][j]-'0')%2!=0)even=true;
          if(!even)continue;
          if(!fl){
            if(i==h-1)continue;
            y[cnt]=i+1;x[cnt]=j+1;
          if(s[i][j]=='0'){
            yy[cnt]=i+2;xx[cnt]=j+1; 
            cnt++;
          }
          else{
          fl=true;
          }
          continue;
          }
          if((s[i][j]-'0')%2!=0){
            even=false;
            fl=false;
            yy[cnt]=i+1;
            xx[cnt]=j+1;
            cnt++;
          }
          else{
            yy[cnt]=i+1;
            xx[cnt]=j+1;
            cnt++;
            if(i!=h-1){
              y[cnt]=i+1;
              x[cnt]=j+1;
            }
          }
        }
        
        Cout(cnt);
        rep(i,cnt){
          cout<<y[i]<<" "<<x[i]<<" "<<yy[i]<<" "<<xx[i]<<"\n";
        }

       
return 0;
}


Measured memory_bytes: 15616