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

namespace ConsoleApplication27
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, a,p,r,d;
            double m;
            string[] s;
            s = Console.ReadLine().Split();
            n = int.Parse(s[0]);
            a = int.Parse(s[1]);
            if (n < 3 * a)
                Console.WriteLine(-1);
            m = (double)n / (2 * a - 2);
            //Console.WriteLine(m);
            if (m == 5)
            {
                Console.WriteLine(a + " " + (a - 2));
                Console.WriteLine((a - 2)+" "+a);
                Console.WriteLine(a + " " + (a - 2));
                Console.WriteLine((a - 2)+" "+a);
                Console.WriteLine(a + " " + (a - 2));
            }
            if (m > 5)
            {
                Console.WriteLine(a + " " + (a - 2));
                Console.WriteLine((a - 2) + " " + a);
                Console.WriteLine(a + " " + (a - 2));
                Console.WriteLine((a - 2) + " " + a);
                p = n - (8 * a - 8);
                Console.WriteLine(((p+2)/2)+" "+((p-2)/2));
            }
            if (m < 5)
            {
                if ((n / a) > 5)
                {
                    r = n - (5 * a);
                    Console.WriteLine(r);
                    if (r > a)
                    {
                        d = r - a + 2;
                        Console.WriteLine(a + " " + (a - 2));
                        Console.WriteLine(d + " " + a);
                        Console.WriteLine(a + " " + 0);
                        Console.WriteLine(0 + " " + a);
                        Console.WriteLine(a + " " + 0);
                    }
                    else
                    {
                        Console.WriteLine(a + " " + r);
                        Console.WriteLine(0 + " " + a);
                        Console.WriteLine(a + " " + 0);
                        Console.WriteLine(0 + " " + a);
                        Console.WriteLine(a + " " + 0);
                    }
                }
            }
        }
    }
}