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)
        {
            int[] linija = Console.ReadLine().Split(new Char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(item => int.Parse(item)).ToArray();
            long N = linija[0];
            long A = linija[1];
            if (N < 3 * A || N == 0 || A == 0 || N<3 || N==A)
            {
                if (N != 3&&A!=1)
                {
                    Console.WriteLine(-1);
                   
                }
               
            }
            else if (N % 2 == 0)
            {
                Console.WriteLine(((N - 2 * A) / 2 - 1) + " " + ((N - 2 * A) / 2 + 1));
                Console.WriteLine(A + " " + 0);
                Console.WriteLine(A + " " + 0);
               

            }
            else
            {
                if (N != 3)
                {
                    N = N - 1;
                    Console.WriteLine((N - 2 * A + 1) + " " + (N - 2 * A - 1));
                    Console.WriteLine(A + " " + 1);
                    Console.WriteLine(A + " " + 0);
                    
                }
            }
            if(N==3 && A == 1)
            {
                Console.WriteLine(1 + " " + 0);
                Console.WriteLine(1 + " " + 0);
                Console.WriteLine(1 + " " + 0);
           
            }
        }
    }
}