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

namespace ConsoleApp7
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int p = int.Parse(s[0]);
            int r = int.Parse(s[1]);
            int i = 0;
            int l, d;
            int x = 0;
            if (p < r * 3) Console.WriteLine(-1);
            else
            {
                int t = p % 3;
                p -= t;
                while (i < 2)
                {
                    l = p / 6 + 1;
                    d = l - 2;
                    x = l + d;
                    Console.WriteLine(l + " " + d);
                    i++;
                }
                l = (p + t - x) / 2;
                if (l < r) l = r;
                d = (p - x) - l;
                Console.WriteLine(l + " " + d);
            }
        }
    }
}