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

using ll = long long;
#define repi(n) for (int i = 0; i < (n); i++)
#define repj(n) for (int j = 0; j < (n); j++)
#define repk(n) for (int k = 0; k < (n); k++)
#define repl(n) for (int l = 0; l < (n); l++)
#define rep(i, n) for (int i = 0; (i) < (n); i++)
#define repr(i, a, b) for (auto i = (a); i < (b); i++)
#define repv(itr) for (auto&& v : (itr))
#define updatemax(t, v) (t = max((t), (v)))
#define updatemin(t, v) (t = min((t), (v)))
const int dx[] = {-1, 0, 0, 1, -1, -1, 1, 1};
const int dy[] = {0, -1, 1, 0, -1, 1, -1, 1};
template <typename T>
T minptr(T begin, T end) {
  T re = begin;
  for (T i = begin + 1; i != end; i++) {
    if (*i < *re) re = i;
  }
  return re;
}
template <typename T>
T maxptr(T begin, T end) {
  T re = begin;
  for (T i = begin + 1; i != end; i++) {
    if (*i > *re) re = i;
  }
  return re;
}
int __vmax(int x) {
  return INT_MAX;
}
double __vmax(double x) {
  return 1e+300;
}
ll __vmax(ll x) {
  return LLONG_MAX;
}
int __vmin(int x) {
  return INT_MIN;
}
double __vmin(double x) {
  return -1e+300;
}
ll __vmin(ll x) {
  return LLONG_MIN;
}
ll modpow(ll a, ll b, ll m) {
  ll re = 1, k = 1;
  while (k <= b) {
    if (b & k) {
      re *= a;
      re %= m;
    }
    k = k << 1;
    a *= a;
    a %= m;
  }
  return re;
}
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
template <typename T>
vector<T> lis(T begin, T end, bool allowequal = false, bool lds = false) {
  using V = typename iterator_traits<T>::value_type;
  int n = end - begin;
  vector<V> a(n, lds ? __vmin(*begin) : __vmax(*begin));
  vector<int> id(n);
  if (lds && allowequal) {
    for (int i = 0; i < n; i++) {
      id[i] = n - 1 -
              (lower_bound(a.rbegin(), a.rend(), begin[i]) - 1 - a.rbegin());
      a[id[i]] = begin[i];
    }
  } else if (lds) {
    for (int i = 0; i < n; i++) {
      id[i] = n - 1 -
              (upper_bound(a.rbegin(), a.rend(), begin[i]) - 1 - a.rbegin());
      a[id[i]] = begin[i];
    }
  } else if (allowequal) {
    for (int i = 0; i < n; i++) {
      id[i] = upper_bound(a.begin(), a.end(), begin[i]) - a.begin();
      a[id[i]] = begin[i];
    }
  } else {
    for (int i = 0; i < n; i++) {
      id[i] = lower_bound(a.begin(), a.end(), begin[i]) - a.begin();
      a[id[i]] = begin[i];
    }
  }
  int m = *maxptr(id.begin(), id.end());
  vector<T> re(m + 1);
  for (int i = n - 1; i >= 0; i--) {
    if (id[i] == m) re[m--] = begin + i;
  }
  return re;
}

int a[500][500];
typedef struct X {
  int x1, y1, x2, y2;
  X(int x1_, int y1_, int x2_, int y2_) {
    x1 = x1_;
    y1 = y1_;
    x2 = x2_;
    y2 = y2_;
  }
} X;
int main() {
  int h, w;
  cin >> h >> w;
  repi(h) repj(w) cin >> a[i][j];
  vector<X> xs;
  int pox2 = -1, poy2 = -1;
  repi(h) {
    int pox = -1;
    repj(w) {
      if (a[i][j] % 2) {
        if (pox >= 0) {
          // cout << "(" << (i + 1) << "," << (pox + 1) << ") -> (" << (i + 1)
          //      << "," << (j + 1) << ")\n";
          for (int x = pox; x < j; x++) {
            X p(x, i, x + 1, i);
            xs.push_back(p);
          }
          pox = -1;
        } else {
          pox = j;
        }
      }
    }
    if (pox >= 0) {
      if (pox2 >= 0) {
        // cout << "(" << (poy2 + 1) << "," << (pox2 + 1) << ") -> (" << (i + 1)
        //      << "," << (pox + 1) << ")\n";
        for (int x = pox2; x < w - 1; x++) {
          X p(x, poy2, x + 1, poy2);
          xs.push_back(p);
        }
        for (int y = poy2; y < i; y++) {
          X p(w - 1, y, w - 1, y + 1);
          xs.push_back(p);
        }
        for (int x = w - 1; x > pox; x--) {
          X p(x, i, x - 1, i);
          xs.push_back(p);
        }
        pox2 = poy2 = -1;
      } else {
        pox2 = pox;
        poy2 = i;
      }
    }
  }
  cout << xs.size() << endl;
  repv(xs) {
    cout << (v.y1 + 1) << " " << (v.x1 + 1) << " " << (v.y2 + 1) << " "
         << (v.x2 + 1) << endl;
  }
}


Measured memory_bytes: 5232