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

namespace Contest
{
    class Scanner
    {
        private string[] line = new string[0];
        private int index = 0;
        public string Next()
        {
            if (line.Length <= index)
            {
                line = Console.ReadLine().Split(' ');
                index = 0;
            }
            var res = line[index];
            index++;
            return res;
        }
        public int NextInt()
        {
            return int.Parse(Next());
        }
        public long NextLong()
        {
            return long.Parse(Next());
        }
        public string[] Array()
        {
            line = Console.ReadLine().Split(' ');
            index = line.Length;
            return line;
        }
        public int[] IntArray()
        {
            var array = Array();
            var result = new int[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                result[i] = int.Parse(array[i]);
            }

            return result;
        }
        public long[] LongArray()
        {
            var array = Array();
            var result = new long[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                result[i] = long.Parse(array[i]);
            }

            return result;
        }
    }

    struct S
    {
        public int X, Y;
    }

    class Program
    {
        private int H, W;
        private int[][] a;
        private void Scan()
        {
            var sc = new Scanner();
            H = sc.NextInt();
            W = sc.NextInt();
            a = new int[H][];
            for (int i = 0; i < H; i++)
            {
                a[i] = sc.IntArray();
            }
        }

        public void Solve()
        {
            Scan();
            var sb = new StringBuilder();
            int count = 0;
            int cc = 0;
            for (int i = 0; i < H; i++)
            {
                for (int j = 0; j < W; j++)
                {
                    if (a[i][j] % 2 == 1) cc++;
                }
            }

            if (cc % 2 == 1)
            {
                cc--;
            }

            bool s = false;
            S point = new S() { X = 0, Y = 0 };
            int kisucnt = 0;
            for (int i = 0; i < H * W; i++)
            {
                var next = Next(point);
                if (a[point.Y][point.X] % 2 == 1)
                {
                    if (s)
                    {
                        kisucnt++;
                        s = false;
                    }
                    else
                    {
                        kisucnt++;
                        if (kisucnt <= cc)
                        {
                            s = true;
                        }
                    }

                }

                if (s)
                {
                    count++;
                    sb.AppendLine($"{point.Y + 1} {point.X + 1} {next.Y + 1} {next.X + 1}");
                }

                point = next;
            }
            Console.WriteLine(count);
            Console.Write(sb.ToString());
        }

        S Next(S p)
        {
            if (p.Y % 2 == 0)
            {
                if (p.X == W - 1)
                {
                    p.Y++;
                }
                else
                {
                    p.X++;
                }
            }
            else
            {
                if (p.X == 0)
                {
                    p.Y++;
                }
                else
                {
                    p.X--;
                }
            }

            return p;
        }

        static void Main() => new Program().Solve();
    }
}

Measured memory_bytes: 27692