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

namespace _1zadTakm
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine()); //ukupan br poena
            int A = int.Parse(Console.ReadLine()); //br poena u 1 setu

            if(N>=3*A&&N<6*A-5)
            {
                int a = N / 3;
                int prvi = a - A;
                int drugi = a - A;
                int treci = a - A + N % 3;
                Console.WriteLine(A.ToString() + " " + prvi.ToString());
                Console.WriteLine(A.ToString() + " " + drugi.ToString()); 
                Console.WriteLine(A.ToString() + " " + treci.ToString());
            }
            else
            {
                if(N>=3*A&&N<8*A-7)
                {
                    int a = N / 4;
                    int prvi = a - A;
                    int drugi = a - A;
                    int treci = a - A;
                    int cetvrti = a - A + N % 4;
                    Console.WriteLine(prvi.ToString() + " " + A.ToString());
                    Console.WriteLine(A.ToString() + " " + drugi.ToString());
                    Console.WriteLine(A.ToString() + " " + cetvrti.ToString());
                    Console.WriteLine(A.ToString() + " " + treci.ToString());
                }
                else
                {
                    if (N >= 3 * A && N < 10 * A - 9)
                    {
                        int a = N / 5;
                        int prvi = a - A;
                        int drugi = a - A;
                        int treci = a - A;
                        int cetvrti = a - A;
                        int peti = a - A + N % 5;
                        Console.WriteLine(prvi.ToString() + " " + A.ToString());
                        Console.WriteLine(peti.ToString() + " " + A.ToString());
                        Console.WriteLine(A.ToString() + " " + drugi.ToString());
                        Console.WriteLine(A.ToString() + " " + cetvrti.ToString());
                        Console.WriteLine(A.ToString() + " " + treci.ToString());
                    }
                    else
                    {
                        if (N >= 3 * A)
                        {
                            int p = N - 8 * A + 10;
                            int prvi = A-2;
                            int drugi =  A-2;
                            int treci =  A-2;
                            int cetvrti =  A-2;
                            if (p % 2 == 1)
                            {
                                prvi -= 3;
                                p += 3;
                            }
                            int peti = (p - 2) / 2;
                            int sesti = p - peti;
                            Console.WriteLine(prvi.ToString() + " " + A.ToString());
                            Console.WriteLine(drugi.ToString() + " " + A.ToString());
                            Console.WriteLine(A.ToString() + " " + treci.ToString());
                            Console.WriteLine(A.ToString() + " " + cetvrti.ToString());
                            Console.WriteLine(peti.ToString() + " " + sesti.ToString());
                            
                        }
                        else Console.WriteLine("-1");
                    }
                }
            }

            Console.ReadKey();
        }
    }
}