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

namespace zadatak2
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int n = Convert.ToInt32(s.Substring(0, s.IndexOf(" ")));
            int a = Convert.ToInt32(s.Substring(s.IndexOf(" ")+1));
            if (n < a * 3)
                Console.WriteLine(-1);
            else if (n % 2 == 0)
            {
                Console.WriteLine(a.ToString() + " 0");
                Console.WriteLine(a.ToString() + " 0");
                Console.WriteLine(Convert.ToString((n - 2 * a) / 2 + 1) + " " + Convert.ToString((n - 2 * a) / 2 - 1));
            }
            if (n%2==1)
            {
                Console.WriteLine(a.ToString() + " 1");
                Console.WriteLine(a.ToString() + " 0");
                Console.WriteLine(Convert.ToString((n - 2 * a) / 2 + 1) + " " + Convert.ToString((n - 2 * a) / 2 - 1));
            }
        }
    }
}