using System;

namespace Odbojka
{
    class Program
    {
        static void Stampaj(int[] p, int[] z, int n)
        {
            for (int i = 0; i < n; i++)
            {
                Console.WriteLine("{0} {1}", p[i], z[i]);
            }
        }
        
        static void Main(string[] args)
        {
            var cin = Console.ReadLine().Split(' ');
            var n = int.Parse(cin[0]);
            var a = int.Parse(cin[1]);

            int m = n / a;

            if (m < 3)
            {
                Console.WriteLine(-1);
                return;
            }

            var r = new Random();
            
            m = m > 5 ? 5 : m;
            m = r.Next(3, m + 1);
            
            var p = new int[m];
            var z = new int[m];

            var b = r.Next(-10, 10) >= 0;

            for (int i = 0; i < m; i++)
            {
                if (b)
                {
                    p[i] = a;
                }
                else
                {
                    z[i] = a;
                }
            }
            
            for (int i = 0; i < -(5 - m - 1); i++)
            {
                var rnd = r.Next(0, m);
                if (!b)
                {
                    p[rnd] = a;
                    z[rnd] = 0;
                }
                else
                {
                    z[rnd] = a;
                    p[rnd] = 0;
                }
            }

            n -= m * a;
            for (int i = 0; i < m && n > 0; i++)
            {
                int rnd1, rnd2;
                do
                {
                    rnd1 = p[i] + r.Next(0, n / (m * 2) + 1);
                    rnd2 = z[i] + r.Next(0, n / (m * 2) + 1);
                }
                while (Math.Abs((p[i] + rnd1) - (z[i] + rnd2)) < 2);

                if (n - (rnd1 + rnd2) < 0)
                {
                    break;
                }

                p[i] += rnd1;
                z[i] += rnd2;
                n -= rnd1 + rnd2;
            }
            while (n > 0)
            {
                int rnd = r.Next(0, n + 1);
                int i = r.Next(0, m);

                if (r.Next(-100, 100) >= 0)
                {
                    if (Math.Abs((p[i] + rnd) - z[i]) >= 2)
                    {
                        p[i] += rnd;
                        n -= rnd;
                    }
                }
                else
                {
                    if (Math.Abs((z[i] + rnd) - p[i]) >= 2)
                    {
                        z[i] += rnd;
                        n -= rnd;
                    }
                }
            }

            Stampaj(p, z, m);
        }
    }
}