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

namespace Odbojka
{
    class Program
    {
        static long n;
        static long a;

        static long[,] rez = new long[2, 3];

        static void Main(string[] args)
        {
            string[] ulaz = Console.ReadLine().Split();
            
            n = Convert.ToInt64(ulaz[0]);
            a = Convert.ToInt64(ulaz[1]);



            if (a * 3 <= n)
            {
                rez[0, 0] = Convert.ToInt64(a);
                rez[0, 1] = Convert.ToInt64(a);
                rez[0, 2] = Convert.ToInt64(a);
                n -= 3 * a;

                
                dodaj();

                Console.WriteLine(rez[0, 0] + " " + rez[1, 0]);
                Console.WriteLine(rez[0, 1] + " " + rez[1, 1]);
                Console.WriteLine(rez[0, 2] + " " + rez[1, 2]);
            }
            else
            {
                Console.WriteLine("-1");
            }

        }

        static void dodaj()
        {
            if (n >= a - 2)
            {
                rez[1, 0] += a - 2;
                n -= a - 2;

                if (n % 2 == 0)
                {
                    long p = n / 2;
                    rez[0, 0] += p;
                    rez[1, 0] += p;
                }
                else
                {
                    long p = n / 2;
                    rez[0, 0] += p;
                    rez[1, 0] += p;
                    rez[1, 1] += 1;
                }
            }
            else if (n < a - 2) {
                rez[1, 0] += n;
                n =0;
            }
        }
    }
}