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

namespace verseny2
{
    class Program
    {
        static void Main(string[] args)
        {
            string inp = Console.ReadLine();
            string in1 = null;
            string in2 = null;
            inp += ' ';
            int i = 0;
            while (inp[i] != ' ')
            {
                in1 += inp[i];
                i++;
            }
            i++;
            while (inp[i] != ' ')
            {
                in2 += inp[i];
                i++;
            }
            int N = Int32.Parse(in1);
            int A = Int32.Parse(in2);
            if (N < 3 * A) 
            {
                Console.WriteLine("-1");
            }
            else
            {
                int K = N;
                int[] P = new int[3];
                int[] M = new int[3];
                if (K % 2 == 0)
                {
                    P[0] = A;
                    M[0] = 0;
                    P[1] = A;
                    M[1] = 0;
                }
                else
                {
                    P[0] = A;
                    M[0] = 1;
                    P[1] = A;
                    M[1] = 0;
                }
                K -= (P[0] + P[1] + M[0] + M[1]);
                if (K < (2 * A) - 2)
                {
                    P[2] = A;
                    M[2] = K - A;
                }
                else
                {
                    P[2] = K / 2 + 1;
                    M[2] = K / 2 - 1;
                }
               
                
               /*if (N - (P[0] + P[1] + M[0] + M[1] + P[2] + M[2]) != 0)
                {
                    M[0]++;
                }*/
                Console.WriteLine(P[0] + " " + M[0]);
                Console.WriteLine(P[1] + " " + M[1]);
                Console.WriteLine(P[2] + " " + M[2]);
                }
        }
    }
}

//92 10


//10 0
//10 0
//35 37