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

namespace ConsoleApp7
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, a, a1 = 0, b1 = 0, y=0, r=0, u = 0;
            string[] input = Console.ReadLine().Split(' ');
            n = Convert.ToInt32(input[0]);
            a = Convert.ToInt32(input[1]);
            if (n > 3 * a)
            {
                Console.WriteLine("{0} {1}", a, a-2);
                u = n - 3 * a + 2;
                if (u%2==0)
                {
                    a1 = (u / 2) + 1;
                    b1 = (u / 2) - 1;
                    Console.WriteLine("{0} {1}", (u / 2) + 1, (u / 2) - 1);
                }
                if (u % 2 != 0)
                {
                    b1 = u / 2-1;
                    a1 = (u / 2) + 1;
                    Console.WriteLine("{0} {1}", (u / 2)+1, u / 2-1);
                }
                r = a1 + b1 + a - 2 + a;
                
                while(r!=n)
                {
                    r = r + a;
                    if (n-r<a)
                    {
                        y = n - r;
                        r = r + y;
                    }
                    Console.WriteLine("{0} {1}", a, y);
                }


            }
            else if (n == 3 * a)
            {
                Console.WriteLine("{0} {1}", a, 0);
                Console.WriteLine("{0} {1}", a, 0);
                Console.WriteLine("{0} {1}", a, 0);
            }
            else
            {
                Console.WriteLine("{0}", -1);
            }
        }
    }
}