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

namespace Odbojka
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            uint n = uint.Parse(s[0]);
            uint a = uint.Parse(s[1]);
            if (n < a * 3) Console.WriteLine(-1);
            else
            {
                uint ost = n - 3*a;
                if (n != 3 * a) 
                {
                    if (ost < a - 2 || ost == a - 2)
                    {
                        Console.WriteLine(a + " " + ost);
                        Console.WriteLine(a + " " + 0);
                        Console.WriteLine(a + " " + 0);
                    }
                    else
                    {
                        ost = ost - (a - 2);
                        if (ost < a - 2 || ost == a - 2)
                        {
                            Console.WriteLine(a + " " + (a-2));
                            Console.WriteLine(a + " " + ost);
                            Console.WriteLine(a + " " + 0);
                        }
                        else
                        {
                            ost = ost - (a - 2);
                            if (ost < a - 2 || ost == a - 2)
                            {
                                Console.WriteLine(a + " " + (a - 2));
                                Console.WriteLine(a + " " + (a - 2));
                                Console.WriteLine(a + " " + ost);
                            }
                            else
                            {
                                ost = ost - (a - 2);
                                if(ost%2==0)
                                {
                                    Console.WriteLine(a + " " + (a - 2));
                                    Console.WriteLine(a + " " + (a - 2));
                                    Console.WriteLine((a+(ost/2)) + " " + (a-2+(ost/2)));
                                }
                                else
                                {
                                    ost = ost + 1;
                                    Console.WriteLine(a + " " + (a - 2));
                                    Console.WriteLine(a + " " + (a - 2 - 1));
                                    Console.WriteLine((a + (ost / 2)) + " " + (a-2 + (ost / 2)));
                                }
                            }
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < 3; i++)
                    {
                        Console.WriteLine(a + " " + 0);
                    }
                }
            }
        }
    }
}