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

namespace ConsoleApp5
{
    class Program
    {

        static void Main(string[] args)
        {
            int n = 0, a = 0;
            string phrase;
            phrase = Console.ReadLine();
            string[] words = phrase.Split(' ');
            foreach (var word in words)
            {
                n = int.Parse(words[0]);
                a = int.Parse(words[1]);
            }

            int k;
            k = n / (a * 2 - 2);


            if (k <= 3 && n > (3 * a + 2))
            {
                Console.WriteLine(a + " " + 1);
                Console.WriteLine(a + " " + 1);
                int r;
                r = n - 2 * a - 2;
                if (r < (2 * a - 2))
                    Console.WriteLine(a + " " + (r - a));
                else
                    Console.WriteLine((r / 2 + 1) + " " + (r / 2 - 1));
            }
            else if (k <= 3 && n >= (3 * a) && n <= (3 * a + 2))
            {
                Console.WriteLine(a + " " + 0);
                Console.WriteLine(a + " " + 0);
                Console.WriteLine(a + " " + (n - 3 * a));
            }
            else if (k == 4 && n > (3 * a + 2))
            {
                Console.WriteLine(a + " " + 1);
                Console.WriteLine(a + " " + 1);
                Console.WriteLine(1 + " " + a);
                int s;
                s = n - 3 * a - 3;
                Console.WriteLine((s / 2 + 1) + " " + (s / 2 - 1));
            }
            else if (k >= 5 && n > (3 * a + 2))
            {
                Console.WriteLine(a + " " + 1);
                Console.WriteLine(a + " " + 1);
                Console.WriteLine(1 + " " + a);
                Console.WriteLine(1 + " " + a);
                int t;
                t = n - 4 * a - 4;
                Console.WriteLine((t / 2 + 1) + " " + (t / 2 - 1));
            }
            else
                Console.WriteLine(-1);


        }
    }
}