#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

int fi[512][512];

int main(void)
{
  int h, w;
  cin >> h >> w;
  REP(i, h) REP(j, w) {
    cin >> fi[i+1][j+1];
  }
  vector<tuple<int,int,int,int> > answer;
  REP(i, h) REP(j, w-1) {
    int y = i+1;
    int x = j+1;
    if(fi[y][x] % 2) {
      answer.emplace_back(y, x, y, x+1);
      ++fi[y][x+1];
    }
  }
  REP(i, h-1) {
    int y = i+1;
    int x = w;
    if(fi[y][x] % 2) {
      answer.emplace_back(y, x, y+1, x);
      ++fi[y+1][x];
    }
  }
  cout << answer.size() << endl;
  for(auto t: answer) {
    int a, b, c, d;
    tie(a, b, c, d) = t;
    cout << a << " " << b << " " << c << " " << d << endl;
  }
  return 0;
}
