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

namespace debug
{
    class main
    {
        static void Main(string[] args)
        {
            //問題クラスを展開
            ProgramD a = new ProgramD();
            a.main();//実行する

        }

    }

    class ProgramA
    {
        public void main()
        {
            //数値入力する
            string[] s = Console.ReadLine().Split(' ');


            //それぞれの文字列で答えを出す
            if ((int.Parse(s[0]) * int.Parse(s[1])) % 2 == 1)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");

        }
    }

    class ProgramB
    {
        public void main()
        {

            //入力
            string input = Console.ReadLine();
            int n = int.Parse(input);

            string[] num = new string[n];


            //char型で読み込み、int型に変換。そこから数を足して、char型に戻す
            for (int i = 0; i < n; i++)
            {
                string s = Console.ReadLine();

                if (num.Contains(s) == true)
                {
                    Console.WriteLine("No");
                    return;
                }

                if (i == 0)
                {
                    num[0] = s;
                }
                else
                {
                    if (num[i - 1][num[i - 1].Length - 1] != s[0])
                    {
                        Console.WriteLine("No");
                        return;
                    }

                    num[i] = s;
                }


            }

            Console.WriteLine("Yes");

        }
    }

    class ProgramC
    {
        public void main()
        {

            //入力
            string[] input = Console.ReadLine().Split();
            long n = long.Parse(input[0]);
            long x = long.Parse(input[1]);

            string[] s = Console.ReadLine().Split();
            long[] a = new long[n];

            //
            for (int i = 0; i < n; i++)
                a[i] = Math.Abs(long.Parse(s[i]) - x);

            if (n == 1)
            {
                Console.WriteLine(a[0]);
                return;
            }

            long ans = gcd(a[0], a[1]);

            for (int i = 2; i < n; i++)
                ans = gcd(ans, a[i]);

            //答え出力
            Console.WriteLine(ans);

        }

        /*最大公約数を求める関数*/
        static long gcd(long p, long q)
        {
            if (p < q)
            {
                long temp = p;
                p = q;
                q = temp;
            }

            long r = 1;

            while (r != 0)
            {
                r = p % q;
                p = q;
                q = r;
            }

            return p;
        }
    }

    class ProgramD
    {
        public void main()
        {

            //入力
            string[] input = Console.ReadLine().Split();
            int h = int.Parse(input[0]);
            int w = int.Parse(input[1]);


            int[,] maze = new int[h, w];
            List<Ans> ans = new List<Ans>();

            //迷路作成
            for (int i = 0; i < h; i++)
            {
                string[] s = Console.ReadLine().Split();
                for (int j = 0; j < w; j++)
                    maze[i, j] = int.Parse(s[j]);
            }

            //１筆書きする
            for (int i = 0; i < h; i++)
            {
                if (i % 2 == 0)
                {
                    for (int j = 0; j < w; j++)
                    {
                        if (maze[i, j] % 2 == 1)
                        {
                            if (j == w - 1)
                            {
                                if (i == h - 1)
                                    break;
                                maze[i + 1, j]++;
                                ans.Add(new Ans(i + 1, j + 1, i + 2, j + 1));

                            }
                            else
                            {
                                maze[i, j + 1]++;
                                ans.Add(new Ans(i + 1, j + 1, i + 1, j + 2));
                            }
                        }
                    }
                }
                else
                {
                    for (int j = w -1; j >= 0; j--)
                    {
                        if (maze[i, j] % 2 == 1)
                        {
                            if (j == 0)
                            {
                                if (i == h - 1)
                                    break;
                                maze[i + 1, j]++;
                                ans.Add(new Ans(i + 1, j + 1, i + 2, j + 1));

                            }
                            else
                            {
                                maze[i, j - 1]++;
                                ans.Add(new Ans(i + 1, j + 1, i + 1, j));
                            }
                        }
                    }

                }
            }

            Console.WriteLine(ans.Count);
            for (int i = 0; i < ans.Count; i++)
                Console.WriteLine(ans[i].a + " " + ans[i].b + " "+ ans[i].c + " " + ans[i].d);

        }
    }

    class Ans
    {
        public int a;
        public int b;
        public int c;
        public int d;
        public Ans(int a, int b, int c, int d)
        {
            this.a = a;
            this.b = b;
            this.c = c;
            this.d = d;
        }
    }



  

}






Measured memory_bytes: 27924