using System;

namespace Zadatak2_kv
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            string[] a1 = a.Split(' ');
            long N = Convert.ToInt64(a1[0]);
            long A = Convert.ToInt64(a1[1]);
            long[] pavle = new long[3];
            long[] zivko = new long[3];
            if (N >= 3 * A)
            {
                if (N > 3 * A + 3 * (A - 2))
                {
                    pavle[0] = A;
                    pavle[1] = A;
                    zivko[0] = A - 2;
                    zivko[1] = A - 2;
                    if ((N - (2 * A + 2 * (A - 2))) % 2 == 0)
                    {
                        pavle[2] = (N - (2 * A + 2 * (A - 2))) / 2 + 1;
                        zivko[2] = (N - (2 * A + 2 * (A - 2))) / 2 - 1;
                    }
                    else
                    {
                        zivko[0] -= 1;
                        pavle[2] = (N - (2 * A + 2 * (A - 2)) + 1) / 2 + 1;
                        zivko[2] = (N - (2 * A + 2 * (A - 2)) + 1) / 2 - 1;
                    }
                }
                else
                {
                    pavle[0] = A;
                    pavle[1] = A;
                    pavle[2] = A;
                    long pom = N - 3 * A;
                    if (pom >= A - 2)
                    {
                        zivko[0] = A - 2;
                        pom -= zivko[0];
                        if (pom > A - 2)
                        {
                            zivko[1] = A - 2;
                            zivko[2] = pom - zivko[1];
                        }
                        else
                        {
                            zivko[1] = pom;
                            zivko[2] = 0;
                        }
                    }
                    else
                    {
                        zivko[0] = pom;
                        zivko[1] = 0;
                        zivko[2] = 0;
                    }
                }
                for (int i = 0; i < 3; i++)
                {
                    Console.WriteLine("{0} {1}", pavle[i], zivko[i]);
                }
            }
            else
            {
                Console.WriteLine(-1);
            }
            Console.ReadLine();
        }
    }
}