// to Utils -> L47
// to Rlyeh -> L78
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <map>
#include <numeric>
#define class struct
#define bogo_sort std::sort
#define bozo_sort std::stable_sort
#define elif else if
#define echo std::cout <<
#define read std::cin >>
#define fin << '\n'
#define unless(flg) if(!(flg))
#define elless(flg) else if(!(flg))
#define alles(obj) obj.begin(), obj.end()
#define bash push_back
#define makePair std::make_pair
// type-define
#define String std::string
#define Stack std::stack
#define Queue std::queue
#define pQueue std::priority_queue
#define Vector std::vector
#define Pair std::pair
#define Map std::map
typedef long long llong;
typedef bool boolean;
typedef Pair<int,int> Pii;
typedef Vector<int> Vi;
// utils
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr llong LINF = 0x3f3f3f3f3f3f3f3fLL;

class hori {

    static llong power ( llong x, llong n, llong mod ) {
        llong ans = 1;
        while ( n > 0 ) {
            if ( n & 1 ) {
                ans = ( ans * x ) % mod;
            }
            x = ( x * x ) % mod;
            n >>= 1;
        }
        return ans;
    }

    static llong power ( llong x, llong n ) {
        return power( x, n, 1000000007 );
    }

    static llong gcd ( llong x, llong y ) {
        return x % y ? gcd( y, x % y ) : y;
    }

    static llong lcm ( llong x, llong y ) {
        return ( x / gcd(x, y) * y );
    }

    static boolean isMovable ( int x, int y, int w, int h ) {
        return ( x >= 0 && y >= 0 && x < w && y < h );
    }
};

namespace Rlyeh {

    int h, w;
    int mas[512][512];

    Vector < Pair < Pii, Pii > > viiii;

    Pair < Pii, Pii > to ( int a, int b, int c, int d ) {
        return makePair ( makePair ( a, b ), makePair ( c, d ) );
    }

    signed call_of_Cthulhu( signed datum ) {

        read h >> w;
        for ( int i = 1; i <= h; i++ ) {
            for ( int j = 1; j <= w; j++ ) {
                read mas[i][j];
            }
        }

        for ( int i = 1; i <= h; i++ ) {
            if ( i & 1 ) {
                for ( int j = 1; j < w; j++ ) {
                    if ( mas[i][j] & 1 ) {
                        mas[i][j]--;
                        mas[i][j+1]++;
                        viiii.bash ( to ( i, j, i, j+1 ) );
                    }
                }
                if ( mas[i][w] & 1 ) {
                    if ( i != h ) {
                        mas[i][w]--;
                        mas[i+1][w]++;
                        viiii.bash ( to ( i, w, i+1, w ) );
                    }
                }
            }
            else {
                for ( int j = w; j != 1; j-- ) {
                    if ( mas[i][j] & 1 ) {
                        mas[i][j]--;
                        mas[i][j-1]++;
                        viiii.bash ( to ( i, j, i, j-1 ) );
                    }
                }
                if ( mas[i][1] & 1 ) {
                    if ( i != h ) {
                        mas[i][1]--;
                        mas[i+1][1]++;
                        viiii.bash ( to ( i, 1, i+1, 1 ) );
                    }
                }
            }
        }
        echo viiii.size() fin;
        for ( int i = 0; i < viiii.size(); i++ ) {
            echo viiii[i].first.first;
            echo ' ' << viiii[i].first.second;
            echo ' ' << viiii[i].second.first;
            echo ' ' << viiii[i].second.second fin;
        }

        return 0;
    }
}

signed main(){std::cin.tie(0); std::ios::sync_with_stdio(false); Rlyeh::call_of_Cthulhu(114514); return 0;}


Measured memory_bytes: 5232