#include<iostream>
#include<string>
#include<string.h>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;
struct node{
    int x1,y1,x2,y2;
};
vector<node> ans;
int a[600][600],h,w;
int main()
{
    scanf("%d%d",&h,&w);
    int i,j;
    for (i=1;i<=h;i++)
        for (j=1;j<=w;j++) scanf("%d",&a[i][j]);
    
    for (i=1;i<=h;i++)
    {
        for (j=1;j<w;j++)
            if (a[i][j]%2) {ans.push_back((node){i,j,i,j+1});a[i][j]--;a[i][j+1]++;}
    }

    for (i=1;i<h;i++)
        if (a[i][w]%2) {ans.push_back((node){i,w,i+1,w});a[i][w]--;a[i+1][w]++;}

    int len=ans.size();
    printf("%d\n",len);
    for (i=0;i<len;i++)
        printf("%d %d %d %d\n",ans[i].x1,ans[i].y1,ans[i].x2,ans[i].y2);
    return 0;
}