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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            String[] input = Console.ReadLine().Split();
            int n = int.Parse(input[0]);
            int a = int.Parse(input[1]);

            int mult = 0;

            for (int i = 0; i < n - ((a * 2) - 2) * 2; i += (a * 2) - 2)
            {
                ++mult;
                Console.Write(a + " ");
                Console.Write(a - 2 + "\n");
            }

            if (mult == 0) { Console.WriteLine(-1); }
            else {

                int final = (n - (mult * ((a * 2) - 2)));

                Console.Write(final/2 + 1 + (final % 2) + " ");
                Console.Write(final/2 - 1 );
            }

            Console.ReadKey();
        }
    }
}