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

namespace petlja1C
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] z = Console.ReadLine().Split(' ');
            int n = int.Parse(z[0]), a = int.Parse(z[1]);

            int[,] x = new int[2, 3];
            int m = n;


            if (n < 3 * a)
            {
                Console.Write(-1);
            }
            else
            {
                for (int i = 0; i < 3; i++)
                {
                    x[0, i] += a;
                    m -= a;
                }
                for (int i = 0; i < 3; i++)
                {
                    if (m > 0)
                    {
                        x[1, i] += m > a ? a - 2 : m;
                        m -= m > a ? a - 2 : m;
                    }
                }
                if (m > 0)
                {
                    if(m%2 == 0)
                    {
                        x[1, 0]--;
                        m++;
                    }
                    x[1, 2]++;
                    m--;
                    x[0, 2] += m / 2;
                    x[1, 2] += m / 2;
                    m = 0;
                }



                for (int i = 0; i < 3; i++) {
                    for (int j = 0; j < 2; j++)
                        Console.Write(x[j, i] + " ");
                    Console.WriteLine();
                }
            }
        }
    }
}