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

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int A = int.Parse(Console.ReadLine());
            int[] niz = new int[6];
            int n = 3, m = 2, p = 1;
            int[,] matrica = new int[n, m];
            if(A > N/4)
            {
                Console.WriteLine("-1");
            }
            else if(p==1)
            {
            niz[0] = A;
            N = N - niz[0];
            niz[1] = A - 2;
            N = N - niz[1];
            niz[2] = A;
            N = N - niz[2];
            niz[3] = A - 2;
            N = N - niz[3];
            p = 2;
            }      
            if (N % 2 == 0 && p ==2)
            {
                niz[4] = (N / 2) + 1;
                niz[5] = (N / 2) - 1;
                Console.Write(niz[0]);
                Console.Write(" ");
                Console.Write(niz[1]);
                Console.WriteLine();
                Console.Write(niz[2]);
                Console.Write(" ");
                Console.Write(niz[3]);
                Console.WriteLine();
                Console.Write(niz[4]);
                Console.Write(" ");
                Console.Write(niz[5]);
                Console.WriteLine();
            }
            else if (N % 2 == 1)
            {
                Console.WriteLine("-1");
            }
            
        }
    }
}