using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int a = Convert.ToInt32(Console.ReadLine());


            int x=a;
            int y;
            if (n >= (3 * a))
            {

                if (n > (x + x - 2 + 2 * a))
                {
                    while (n > (x + x - 2 + 2 * a))
                    {
                        x += 1;
                    }
                    x -= 1;
                     Console.WriteLine("{0}  {1}", x, x - 2);
                    y = n - (x + x - 2 + 2 * a);
                    Console.WriteLine("{0} {1}", a, y);
                    Console.WriteLine("{0} {1}", a, 0);
                }
                if (n == 3 * a)
                {
                    Console.WriteLine("{0} {1}", a, 0);
                    Console.WriteLine("{0} {1}", a, 0);
                    Console.WriteLine("{0} {1}", a, 0);
                }
                if (n <= (x + x - 2 + 2 * a))
                {
                    x = a;
                    y=n-3*x-2;
                    Console.WriteLine("{0} {1}", x, y);
                    y = n - (x + y + 2 * a);
                    Console.WriteLine("{0} {1}", x, y);
                    Console.WriteLine("{0} {1}", x, 0);
                }
            }
            else
            {
                Console.WriteLine("-1");
            }
        }
    }
}