function gets(str){
  this._s = str.split("\n");
  this._y = 0;
};
gets.prototype = {
  a: function(f){
    var s = this._s, y = this._y, r;
    if(typeof s[y] === "string")s[y] = s[y].split(" ").reverse();
    r = s[y].pop();
    if(!s[y].length)this._y++;
    return f?r:+r;
  },
  l: function(f){
    var s = this._s[this._y++].split(" ");
    return f?s:s.map(a=>+a);
  },
  m: function(n,f){
    var s = this._s, y = this._y, r = [], i = 0;
    if(f)for(;i < n; i++)r[i] = s[y+i].split(" ");
    else for(;i < n; i++)r[i] = s[y+i].split(" ").map(a=>+a);
    this._y += n;
    return r;
  },
};
var o=new gets(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var h = o.a();
  var w = o.a();
  var a = o.m(h);
  var ans = [[0]];
  for(var i = 0; i < h; i++){
    for(var j = 0; j < w-1; j++){
      if(a[i][j] & 1){
        ans.push([i+1,j+1,i+1,j+2]);
        a[i][j]--;a[i][j+1]++;
      }
    }
    if(i === h-1)break;
    if(a[i][j] & 1){
      ans.push([i+1,j+1,i+2,j+1]);
      a[i][j]--;a[i+1][j]++;
    }
  }
  ans[0][0] = ans.length-1;
  return ans.map(a=>a.join(" ")).join("\n");
}