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

namespace Zadatak_2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            long N = Convert.ToInt64(input[0]);
            long A = Convert.ToInt64(input[1]);

            if (N / 3 < A)
            {
                Console.WriteLine("-1");
            }
            else if (N % 3 == 0)
            {
                Console.WriteLine("{0} {1}", 0, N / 3);
                Console.WriteLine("{0} {1}", 0, N / 3);
                Console.WriteLine("{0} {1}", 0, N / 3);
            }
            else
            {
                if (N % 2 == 0)
                {
                    long x = (N - 2 * A) / 2;

                    Console.WriteLine("{0} {1}", x + 1, x - 1);
                    Console.WriteLine("{0} 0", A);
                    Console.WriteLine("{0} 0", A);
                }
                else
                {
                    long x = ((N - 1) - 2 * A) / 2;

                    Console.WriteLine("{0} {1}", x + 1, x - 1);
                    Console.WriteLine("{0} 1", A);
                    Console.WriteLine("{0} 0", A);
                }
            }
        }
    }
}