#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 501;

int a[N][N];

struct Move {
  int x1, y1, x2, y2;
};

            // up, left, down, right
int dx[4] = {0, -1, 0, 1}, dy[4] = {-1, 0, 1, 0};

void solve() {
  int h, w; scanf("%d%d", &h, &w);
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      scanf("%d", a[i]+j);
    }
  }
  vector<Move> v;
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      if (a[i][j]%2 == 0) continue;
      for (int k = 0; k < 4; ++k) {
	if (i+dy[k] < 0 || i+dy[k] >= h || j+dx[k] < 0 || j+dx[k] >= w) continue;
	if (a[i+dy[k]][j+dx[k]]%2==0) continue;
	v.push_back({i+1, j+1, i+dy[k]+1, j+dx[k]+1});
	--a[i][j];
	++a[i+dy[k]][j+dx[k]];
	break;
      }
      if (a[i][j]%2 == 0) continue;
      for (int k = 2; k < 4; ++k) {
	if (i+dy[k] < 0 || i+dy[k] >= h || j+dx[k] < 0 || j+dx[k] >= w) continue;
	v.push_back({i+1, j+1, i+dy[k]+1, j+dx[k]+1});
	--a[i][j];
	++a[i+dy[k]][j+dx[k]];
	break;
      }
    }
  }
  printf("%d\n", v.size());
  for (const auto &e: v) {
    printf("%d %d %d %d\n", e.x1, e.y1, e.x2, e.y2);
  }
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
using namespace std;

using ll = long long;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
constexpr int INF = 1e9;
constexpr long long INFLL = 1LL<<60;

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

  int h, w; cin >> h >> w;
  vector<vector<int>> a(h, vector<int>(w));
  rep(i, h) rep(j, w) cin >> a[i][j];

  vector<vector<int>> ans;

  rep(i, h) {
    rep(j, w) {
      if (a[i][j] % 2 == 0) continue;
      if (j < w-1) {
        ans.push_back({i, j, i, j+1});
        a[i][j+1]++;
      } else if (i < h-1) {
        ans.push_back({i, j, i+1, j});
        a[i+1][j]++;
      }
    }
  }

  cout << ans.size() << endl;
  for (auto& v : ans) {
    for (int j = 0; j < v.size(); j++) {
      cout << v[j] + 1;
      if (j == v.size() - 1) cout << endl;
      else cout << " ";
    }
  }

  return 0;
}
