#include <bits/stdc++.h>

using namespace std;


#define MAXN 501
int main() {
  int h, w, a[MAXN][MAXN];
  vector<pair<int, int>> ans;
  cin >> h >> w;
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < h; ++i) {
    for (int j = 1; j < w; ++j) {
      if (a[i][j-1]%2) {
        ans.push_back({i, j-1});
        ans.push_back({i, j});
        a[i][j]++;
      }
    }
  }
  for (int i = 1; i < h; ++i) {
    if (a[i-1][w-1]%2) {
      ans.push_back({i-1, w-1});
      ans.push_back({i, w-1});
      a[i][w-1]++;
    }
  }
  cout << ans.size()/2 << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i].first+1 << " " << ans[i].second+1;
    if (i%2) cout << endl;
    else cout << " ";
  }
  return 0;
}
