using System;

namespace Zadatak2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]), a = int.Parse(s[1]);
            int ostatak = 0, ostatakod = 0, pobed = 0, gubit = 0;
            if (n < a * 3)
            {
                Console.WriteLine("-1");
            }
            else if (n < a * 4)
            {
                if (n > (a * 3 + (a - 2) * 3))
                {
                    Console.WriteLine("-1");
                }
                ostatak = n - a * 3;
                ostatakod = ostatak % 3;
                pobed = a;
                gubit = ostatak / 3;
                Console.WriteLine(pobed + " " + gubit);
                if (ostatakod == 2)
                {
                    Console.WriteLine(pobed + " " + (gubit + 1));
                    Console.WriteLine(pobed + " " + (gubit + 1));
                }
                else if (ostatakod == 1)
                {
                    Console.WriteLine(pobed + " " + (gubit + 1));
                    Console.WriteLine(pobed + " " + (gubit + 1));
                }
                else
                {
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(pobed + " " + gubit);
                }
            }
            else if (n < a * 5)
            {
                if (n > (a * 4 + (a - 2) * 4))
                {
                    Console.WriteLine("-1");
                }
                ostatak = n - a * 4;
                ostatakod = ostatak % 4;
                pobed = a;
                gubit = ostatak / 4;
                Console.WriteLine(pobed + " " + gubit);
                if (ostatakod == 3)
                {
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine(pobed + " " + (gubit + 1));
                    Console.WriteLine(pobed + " " + (gubit + 1));
                }
                else if (ostatakod == 2)
                {
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine(pobed + " " + (gubit + 1));
                    Console.WriteLine(pobed + " " + gubit);
                }
                else if (ostatakod == 1)
                {
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(pobed + " " + gubit);
                }
                else
                {
                    Console.WriteLine(gubit + " " + pobed);
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(pobed + " " + gubit);
                }
            }
            else if (n < a * 6)
            {
                if (n > (a * 5 + (a - 2) * 5))
                {
                    Console.WriteLine("-1");
                }
                ostatak = n - a * 5;
                ostatakod = ostatak % 5;
                pobed = a;
                gubit = ostatak / 5;
                Console.WriteLine(pobed + " " + gubit);
                if (ostatakod == 4)
                {
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine(pobed + " " + (gubit + 1));
                    Console.WriteLine(pobed + " " + (gubit + 1));
                }
                else if (ostatakod == 3)
                {
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine(pobed + " " + (gubit + 1));
                    Console.WriteLine(pobed + " " + gubit);
                }
                else if (ostatakod == 2)
                {
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(pobed + " " + gubit);
                }
                else if (ostatak == 1)
                {
                    Console.WriteLine((gubit + 1) + " " + pobed);
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(pobed + " " + gubit);
                }
                else if (ostatakod == 0)
                {
                    Console.WriteLine(gubit + " " + pobed);
                    Console.WriteLine(gubit + " " + pobed);
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(pobed + " " + gubit);
                }
            }
            else
            {
                pobed = a;
                gubit = 0;
                if (n % 2 == 1)
                {
                    Console.WriteLine(pobed + " " + (gubit + 1));
                    Console.WriteLine(gubit + " " + pobed);
                    Console.WriteLine(gubit + " " + pobed);
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(((n - a * 4) / 2 + 1) + " " + (((n - a * 4) / 2 - 1)));
                }
                else
                {
                    Console.WriteLine(gubit + " " + pobed);
                    Console.WriteLine(gubit + " " + pobed);
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(pobed + " " + gubit);
                    Console.WriteLine(((n - a * 4) / 2 + 1) + " " + (((n - a * 4) / 2 - 1)));
                }
            }
        }
    }
}