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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int total, minPoints;

            string[] tempS = Console.ReadLine().Split(' ');

            total = Convert.ToInt32(tempS[0]);

            minPoints = Convert.ToInt32(tempS[1]);

            List<int> teamP=new List<int> { 0, 0, 0 }, teamZ = new List<int> { 0, 0, 0 };

            if (total >= 3 * minPoints-6)
            {
                for (int i = 0; i < 3; i++)
                {
                    teamP[i]=minPoints;
                    total -= minPoints;
                }
                if (total - 3 * minPoints + 6 < 0)
                {
                    int temp = total / 3;
                    for (int i = 0; i < 3; i++)
                    {
                        teamZ[i] = temp;
                        total -= temp;
                    }
                    int j = 0;
                    while (total > 0)
                    {
                        teamZ[j] += 1;
                        --total;
                        ++j;
                    }
                    for (int i = 0; i < 3; i++)
                    {
                        Console.WriteLine("{0} {1}", teamP[i], teamZ[i]);
                    }
                }
                else
                {   
                    for (int i = 0; i < 3; i++)
                    {
                        teamZ[i] = minPoints - 2;
                        total -= minPoints - 2;
                    }

                    if (total % 2 != 0)
                    {
                        teamZ[2] -= 1;
                        total += 1;
                    }

                    teamP[0] += total / 2;
                    teamZ[0] += total / 2;

                    for (int i = 0; i < 3; i++)
                    {
                        Console.WriteLine("{0} {1}", teamP[i], teamZ[i]);
                    }
                }

            }
            else
            {
                Console.WriteLine(-1);
            }
        }
    }
}