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

namespace ConsoleApplication1
{
    class Program
    {
        static int bez_fun(int rez, int n, int m)
        {
            if (rez < 0)
            {
                Console.WriteLine(-1);
                return 0;
            }
            if (rez % 2 != 0)
            {
                rez++;
                rez /= 2;
                if (rez % 2 != 0)
                {
                    rez++;
                    rez /= 2;
                    Console.WriteLine((rez - 1) + " " + (rez + 1));
                    Console.WriteLine((rez - 1) + " " + (rez + 1));
                    Console.WriteLine(n + " " + (n - 5));
                }
                else
                {
                    rez /= 2;
                    Console.WriteLine((rez - 1) + " " + (rez + 1));
                    Console.WriteLine((rez - 1) + " " + (rez + 1));
                    Console.WriteLine(n + " " + (n - 3));
                }
            }
            else
            {
                rez /= 2;
                if (rez % 2 != 0)
                {
                    rez++;
                    rez /= 2;
                    Console.WriteLine((rez - 1) + " " + (rez + 1));
                    Console.WriteLine((rez - 1) + " " + (rez + 1));
                    Console.WriteLine(n + " " + (n - 4));
                }
                else
                {
                    rez /= 2;
                    Console.WriteLine((rez - 1) + " " + (rez + 1));
                    Console.WriteLine((rez - 1) + " " + (rez + 1));
                    Console.WriteLine(n + " " + (n - 2));
                }
            }
            return 0;
        }
        static void Main(string[] args)
        {
            string[] a = Console.ReadLine().Split();
            int m = int.Parse(a[0]);
            int n = int.Parse(a[1]);
            int rez = m-(n + (n - 2));
            bez_fun(rez, n, m);
        }
    }
}