#include <set>
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <limits>
#include <map>
#include <numeric>

#define ll long long
using namespace std;
static ll imin = std::numeric_limits<ll>::min();
static ll imax = std::numeric_limits<ll>::max();
#define rep(i, n) for(int i = 0; (i)<(n); ++(i))
#define rep1(i, n) for(int i = 1; (i)<(n); ++(i))
#define rev_rep(i, n) for(int i = (n) - 1; (i) >= 0; --(i))
#define range(a, i, b) for(int i = (a); (i) < (b); ++(i))
#define dump(x) cout << #x << ":" << x << "\n";
#define all(v) v.begin(), v.end()
#define readl(N) ll N; cin >> N
#define readlv(N, vec) vector<ll> vec(N); rep(i, N){cin >> vec[i];}
#define greater_than [](ll l, ll r){return l > r;}
template<class T1, class T2>
std::ostream& operator << (std::ostream& os, std::map<T1, T2>& mp);
template<class T1, class T2>
std::ostream& operator << (std::ostream& os, std::pair<T1, T2>& pair);
template<class T>
std::ostream& operator << (std::ostream& os, std::vector<T>& vec);
template<class T1, class T2>
std::ostream& operator << (std::ostream& os, std::pair<T1, T2>& pair){
  os << '(' << pair.first << ',' << pair.second << ')';
  return os;
}

template<class T>
std::ostream& operator << (std::ostream& os, std::vector<T>& vec){
  std::size_t n = vec.size();
  if(n == 0){
    return os;
  }
  os << " ";
  for(ll i = 0; i<n - 1; ++i){
    os << vec[i] << " ";
  }
  os << vec[n - 1];
  os << std::endl;
  return os;
}

template<class T1, class T2>
std::ostream& operator << (std::ostream& os, std::map<T1, T2>& mp){
  std::size_t n = mp.size();
  if(n == 0){
    return os;
  }
  os << " ";
  for(auto && x:mp){
    os << x << " ";
  }
  os << std::endl;
  return os;
}

template<class T>
std::ostream& operator << (std::ostream& os, std::set<T>& mp){
  std::size_t n = mp.size();
  if(n == 0){
    return os;
  }
  os << " ";
  for(auto && x:mp){
    os << x << " ";
  }
  os << std::endl;
  return os;
}

template<class T> inline bool chmin(T& a, T const b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T const b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

#ifndef BOOST_TEST_MAIN
int main(int const argc, char const** argv){
  readl(H);
  readl(W);
  auto a = vector<vector<ll>>(H, vector<ll>(W));
  vector<vector<ll>> ops;
  rep(i, H){
    rep(j, W){
      cin >> a[i][j];
    }
  }
  bool l2r = true;
  rep(h, H){
    if(l2r){
      rep(w, W){
        if(a[h][w] % 2 == 1){
          if(w < W - 1){
            a[h][w + 1]++;
            ops.push_back({h + 1, w + 1, h + 1, w + 2});
          }else if(h < H - 1){
            ops.push_back({h + 1, w + 1, h + 2, w + 1});
            a[h + 1][w]++;
          }else{
            // a[h][w - 1]++;
          }
        }
      }
    }else{
      rev_rep(w, W){
        if(a[h][w] % 2 == 1){
          if(0 < w){
            a[h][w - 1]++;
            ops.push_back({h + 1, w + 1, h + 1, w});
          }else if(h < H - 1){
            a[h + 1][w]++;
            ops.push_back({h + 1, w + 1, h + 2, w + 1});
          }else{
            // a[h][w + 1]++;
          }
        }
      }
    }
    l2r = !l2r;
  }

  // dump(a);
  cout << ops.size() << endl;
  for(auto&& x:ops){
    cout << x[0] << " " << x[1] << " " << x[2] << " " << x[3] << endl;
  }
}
#endif


Measured memory_bytes: 12976