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)
        {
            string line = Console.ReadLine();
            var data = line.Split(' ');
            int N = int.Parse(data[0]);
            int A = int.Parse(data[1]);
            if (N < 3 * A) Console.WriteLine(-1);
            else
            {
                N -= 2 * A;
                int t = 0;
                if (N > 2 * A - 1)
                {
                    t = N % 2;
                    int x = N / 2 + 1;
                    Console.WriteLine(x + " " + (x - 2));
                }
                else Console.WriteLine(A + " " + (N-A));
                Console.WriteLine(A + " " + t);
                Console.WriteLine(A + " 0");
            }
            Console.ReadLine();
        }
    }
}