using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        cin = new Scanner();
        new Myon().calc();
        return 0;
    }

    static Scanner cin;

    struct state { public int X; public int Y; public state(int x, int y) { X = x;Y = y; } }
    // メンバ変数---
    int H;
    int W;
    int[,] A;
    // -------------

    void calc()
    {
        H = cin.nextInt();
        W = cin.nextInt();
        A = new int[H, W];
        for(int i = 0;i < H; i++)
        {
            for(int j = 0;j < W; j++)
            {
                A[i, j] = cin.nextInt();
            }
        }

        bool isStartLeft = true;
        List<state> states = new List<state>();
        for (int i = 0; i < H; i++)
        {
            if (isStartLeft)
            {
                // 左から
                for (int j = 0; j < W; j++)
                {
                    states.Add(new state(j, i));
                }
            }
            else
            {
                //　右から
                for (int j = W - 1; -1 < j; j--)
                {
                    states.Add(new state(j, i));
                }
            }
            isStartLeft = !isStartLeft;
        }

        List<string> ret = new List<string>();
        for(int i = 0;i < states.Count-1; i++)
        {
            if(A[states[i].Y, states[i].X] % 2 == 1)
            {
                A[states[i+1].Y, states[i+1].X] += 1;
                ret.Add(string.Format("{0} {1} {2} {3}", states[i].Y+1, states[i].X+1, states[i + 1].Y+1, states[i + 1].X+1));
            }
        }

        Write(ret.Count);
        ret.ForEach(x => Write(x));
    }


    void Write<T>(T v)
    {
        Console.WriteLine(v);
    }

    int Pow(int x, int y)
    {
        return (int)Math.Pow(double.Parse(x.ToString()), double.Parse(y.ToString()));
    }

    double Pow(double x, double y)
    {
        return Math.Pow(x, y);
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }
}


Measured memory_bytes: 34852