/**
 * Problem:	D. 
 * Author:	hkxadpall. 
 * Date:	2018-09-01. 
 * Upload:	AtCoder. 
 */
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue> 
#include <map>
#include <set>
using namespace std;

namespace AuthorName { 
    template <typename _TpInt> inline _TpInt read();
    template <typename _TpRealnumber> inline double readr();
    template <typename _TpInt> inline void write(_TpInt x);
//	template <typename _TpSwap> inline void swap(_TpSwap &x, _TpSwap &y);
	
#	define Max_N 507
	
	int a[Max_N][Max_N] = {0};
	int h, w;
	struct Ans{
		int a, b, c, d;
	};
	vector <Ans> ans;
	
	int main() 
	{
		h = read<int>();
		w = read<int>();
		int sum = 0;
		for (int i = 1; i <= h; i++) {
			for (int j = 1; j <= w; j++) {
				a[i][j] = read<int>();
				sum += a[i][j];
			}
		}
		for (int i = 1; i <= h; i++) {
			for (int j = 1; j <= w; j++) {
				if (a[i][j] & 1) {
					if (i < h && (a[i + 1][j] & 1)) {
						ans.push_back((Ans){i, j, i + 1, j});
						a[i + 1][j] ++;
						continue;
					}
					else if (j < w && (a[i][j + 1] & 1)) {
						ans.push_back((Ans){i, j, i, j + 1});
						a[i][j + 1] ++;
						continue;
					}
					else if (i < h && i <= j) {
						ans.push_back((Ans){i, j, i + 1, j});
						a[i + 1][j] ++;
						continue;
					}
					else if (j < w) {
						ans.push_back((Ans){i, j, i, j + 1});
						a[i][j + 1] ++;
						continue;
					}
					else if (i < h) {
						ans.push_back((Ans){i, j, i + 1, j});
						a[i + 1][j] ++;
						continue;
					}
					else {
						continue;
					}
				}
//				a[i][j] = read<int>();
//				sum += a[i][j];
			}
		}
		write(ans.size()); putchar(10);
		for (int i = 0; i < ans.size(); i++) {
			printf("%d %d %d %d\n", ans[i].a, ans[i].b, ans[i].c, ans[i].d);
		}
		
		
	    return 0;
	}

#	define Getchar() getchar()

    template <typename _TpInt>
    inline _TpInt read()       
    {
        register int flag = 1;
        register char c = Getchar();
        while ((c > '9' || c < '0') && c != '-') 
            c = Getchar();
        if (c == '-') flag = -1, c = Getchar();
        register _TpInt init = (c & 15);
        while ((c = Getchar()) <= '9' && c >= '0') 
            init = (init << 3) + (init << 1) + (c & 15);
        return init * flag;
    }

    template <typename _TpRealnumber>
    inline double readr()       
    {
        register int flag = 1;
        register char c = Getchar();
        while ((c > '9' || c < '0') && c != '-') 
            c = Getchar();
        if (c == '-') flag = -1, c = Getchar();
        register _TpRealnumber init = (c & 15);
        while ((c = Getchar()) <= '9' && c >= '0') 
            init = init * 10 + (c & 15);
        if (c != '.') return init * flag;
        register _TpRealnumber l = 0.1;
        while ((c = Getchar()) <= '9' && c >= '0') 
            init = init + (c & 15) * l, l *= 0.1;
        return init * flag;
    }

    template <typename _TpInt>
    inline void write(_TpInt x)
    {
        if (x < 0) {
            putchar('-');
            write<_TpInt>(~x + 1);
        }
        else {
            if (x > 9) write<_TpInt>(x / 10);   
            putchar(x % 10 + '0');
        }
    }

//	template <typename _TpSwap>
//	inline void swap(_TpSwap &x, _TpSwap &y)
//	{
//	    _TpSwap t = x;
//	    x = y;
//	    y = t;
//	}
}

int main()
{
    AuthorName::main();
    return 0;
}

Measured memory_bytes: 5104