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

namespace prog_Ia_2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] u = Console.ReadLine().Split();
            int N = Convert.ToInt32(u[0]);
            int A = Convert.ToInt32(u[1]);



            int g = N / A;
            if(g<3)
            {
                Console.WriteLine(-1);
            }
            else
            {
                if (g >= 5)
                    g = 5;
                int n = g;

                int y;

                for (; n >= 3; n--)
                {
                    y = (N - (n - 1) * A+2);
                    if(y%2==0)
                    {
                        
                        for (int i = 0; i < (n - 1); i++)
                        {
                            if((g==5 && (i==1 || i==2)) || (g==4 && i==1))
                                Console.WriteLine(A + " " + 0);
                            else
                                Console.WriteLine(0 + " " + A);

                        }
                            
                            
                        y /= 2;
                        int z = y - 2;
                        Console.WriteLine(z + " " + y);


                        break;
                    }
                }
                if (n == 2)
                    Console.WriteLine(-1);

                

            }
            //Console.ReadKey();
        }
    }
}