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