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

namespace ConsoleApplication19
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int A = int.Parse(Console.ReadLine());
            if (N == A)
            {
                Console.WriteLine("-1");
                return;
            }
            int a1 = 0, b1 = 0, a2=0, b2=0, a3=0, b3=0, a4=0, b4=0, a5=0, b5=0;
            a1 = A;
            b1 = A - 1;
            N = N-2*A+1;
            a2 = A;
            b2 = A-1;
            N = N-2*A+1;
            if (N < 2 * A)
            {
                a3 = A;
                b3 = N - A;
                Console.Write(a1 + " ");
                Console.WriteLine(b1);
                Console.Write(a2 + " ");
                Console.WriteLine(b2);
                Console.Write(a3 + " ");
                Console.Write(b3);
                Console.WriteLine(" ");
                return;
            }
            else
            {
                a3 = A;
                b3 = A - 1;
                N = N - 2 * A + 1;
                if (N < 2 * A)
                {
                    a3 = A;
                    b3 = N - A;
                    Console.Write(a1 + " ");
                    Console.WriteLine(b1);
                    Console.Write(a2 + " ");
                    Console.WriteLine(b2);
                    Console.Write(a3 + " ");
                    Console.WriteLine(b3);
                    Console.Write(a4 + " ");
                    Console.Write(b3);
                    Console.WriteLine(" ");
                    return;
                }
            }
        }
    }
}