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

namespace AtCorder
{
	public class Program
	{
		static void Main(string[] args)
		{
			Scanner cin = new Scanner();
			int h = cin.Int();
			int w = cin.Int();
			int[,] a = new int[h, w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					a[i, j] = cin.Int();
				}
			}

			List<PP> anss = new List<PP>();
			List<P> temp = new List<P>();
			bool jun = true;
			bool gets = false;
			for (int i = 0; i < h; i++) {
				if (jun) {
					for (int j = 0; j < w; j++) {
						if (a[i, j] % 2 == 1) {
							temp.Add(new P { X = j + 1, Y = i + 1 });
							if (gets) {
								for (int k = 1; k < temp.Count; k++) {
									anss.Add(new PP {
										X = temp[k - 1].X,
										Y = temp[k - 1].Y,
										XP = temp[k].X,
										YP = temp[k].Y });
								}
								temp.Clear();
								gets = false;
							} else {
								gets = true;
							}
						} else {
							if (gets) {
								temp.Add(new P { X = j + 1, Y = i + 1 });
							} else {
							}
						}
					}
				} else {
					for (int j = w - 1; j >= 0; --j) {
						if (a[i, j] % 2 == 1) {
							temp.Add(new P { X = j + 1, Y = i + 1 });
							if (gets) {
								for (int k = 1; k < temp.Count; k++) {
									anss.Add(new PP {
										X = temp[k - 1].X,
										Y = temp[k - 1].Y,
										XP = temp[k].X,
										YP = temp[k].Y
									});
								}
								temp.Clear();
								gets = false;
							} else {
								gets = true;
							}
						} else {
							if (gets) {
								temp.Add(new P { X = j + 1, Y = i + 1 });
							} else {
							}
						}
					}
				}

				jun = !jun;
			}

			if (temp.Count >= 2) {
				for (int k = 1; k < temp.Count - 1; k++) {
					anss.Add(new PP {
						X = temp[k - 1].X,
						Y = temp[k - 1].Y,
						XP = temp[k].X,
						YP = temp[k].Y
					});
				}
			}

			Console.WriteLine(anss.Count);
			foreach (var pp in anss) {
				Console.WriteLine($"{pp.Y} {pp.X} {pp.YP} {pp.XP}");
			}
		}

		public struct P
		{
			public int X;
			public int Y;
		}

		public struct PP
		{
			public int X;
			public int Y;
			public int XP;
			public int YP;
		}
	}

	public 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 Int()
		{
			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] = Int() + add;
			}
			return Array;
		}

		public long Long()
		{
			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] = Long() + add;
			}
			return Array;
		}

		public double Double()
		{
			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] = Double() + add;
			}
			return Array;
		}
	}
}


Measured memory_bytes: 24104