using System;

class Program
{
    static void Main(string[] args)
    {
        int n, a;
        string[] linija = Console.ReadLine().Split(' ');
        n = int.Parse(linija[0]); a = int.Parse(linija[1]);
        if (n < 3 * a)
        {
            Console.WriteLine(-1);
            return;
        }
        if (n < 4 * a)
        {
            if ((n-3*a) == a-1)
            {
                Console.WriteLine(a + " " + 1);
                Console.WriteLine(a + " " + 0);
                Console.WriteLine(a + " " + ((n - 3 * a) - 1));
                return;
            }
            Console.WriteLine(a + " " + 0);
            Console.WriteLine(a + " " + 0);
            Console.WriteLine(a + " " + (n - 3 * a));
            return;
        }
        if (n == 4 * a)
        {
            Console.WriteLine(a + " " + 1);
            Console.WriteLine(a + " " + 1);
            Console.WriteLine(a + " " + (a-2));
            return;
        }
        if (n < 5 * a)
        {
            Console.WriteLine(a + " " + 1);
            Console.WriteLine(a + " " + 0);
            Console.WriteLine();
            return;
        }
        int x = n - 3 * a;
        if (x % 2 == 0)
        {
            int p = (x / 2) + 1;
            int d = (x / 2) - 1;
            int r=0, m=0;
            if (a % 2 == 0)
            {
                r = a / 2;
                m = a / 2;
            }
            else
            {
                r = (a - 1) / 2 + 1;
                m = (a - 1) / 2;
            }
            Console.WriteLine(a + " " + r);
            Console.WriteLine(a + " " + m);
            Console.WriteLine(p + " " + d);
            return;
        }
        int prvi = (x - 1) / 2 + 1;
        int drugi = (x - 1) / 2 - 1;
        int u = 0, o = 0;
        if (a % 2 == 0)
        {
            u = a / 2 + 1;
            o = a / 2;
        }
        else
        {
            u = (a - 1) / 2 + 1;
            o = (a - 1) / 2;
        }
        Console.WriteLine(a + " " + u);
        Console.WriteLine(a + " " + o);
        Console.WriteLine(prvi + " " + drugi);
    }
}