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

namespace ODBOJKA
{
    class Program
    {
        static void Main(string[] args)
        {
            uint x, y, z, p;
            string[] s = Console.ReadLine().Split();
            uint n = uint.Parse(s[0]);
            uint a = uint.Parse(s[1]);
            if (n < 3 * a) Console.WriteLine(-1);
            else
            {
                p = (n - a) / 10;
                if (p % 2 == 0)
                {
                    x = p / 2 * 10;
                    y = x;
                }
                else
                {
                    x = p / 2 * 10 + 10;
                    y = p / 2 * 10;
                }
                z = n - p * 10;
                Console.WriteLine(x / 2 + 1 + " " + (x / 2 - 1));
                Console.WriteLine(y / 2 + 1 + " " + (y / 2 - 1));
                Console.WriteLine(a + " " + (z - a));
            }
        }
    }
}