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 + " " + 0);
            Console.WriteLine(a + " " + 0);
            Console.WriteLine((n - 3 * a) + " " + a);
            return;
        }
        int x = n - 3 * a;
        if (x % 2 == 0)
        {
            int p = (x / 2) + 1;
            int d = (x / 2) - 1;
            Console.WriteLine(a + " " + 0);
            Console.WriteLine(a + " " + 0);
            Console.WriteLine(p + " " + d);
            return;
        }
        int prvi = (x - 1) / 2 + 1;
        int drugi = (x - 1) / 2 - 1;
        Console.WriteLine(a + " " + 1);
        Console.WriteLine(a + " " + 0);
        Console.WriteLine(prvi + " " + drugi);
    }
}