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

namespace odbojka
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int p = s.IndexOf(" ");
            int n = int.Parse(s.Substring(0,p));
            int a = int.Parse(s.Substring(p+1));
            int g = n / a;
            if (g < 3)
            {
                Console.WriteLine("-1");
            }
            if (g == 3)
            {
                for (int i = 0; i < g; i++)
                {
                  int t1 = a;
                  int t2 = 0;
                  Console.WriteLine(t1+" "+t2);
                }
            }
            if (g == 4)
            {
                int t1 = a;
                int z = Convert.ToInt32(t1 * g);
                n = n - z;
                int t2;
                for (int i = 0; i < g; i++)
                {
                    if (n >= a - 2)

                    { t2 = (a - 2); }
                    else
                    { t2 = n; }
                    if (i == 2)
                    {
                        Console.WriteLine(t2+" "+t1);
                    }
                    else
                    {
                        Console.WriteLine(t1+" "+t2);
                    }

                    n -= t2;
                }
            }
            if (g == 5)
            {
                int t1 = a;
                int z = Convert.ToInt32(t1 * g);
                n = n - z;
                int t2;
                for (int i = 0; i < g; i++)
                {
                    if (n >= a - 2)

                    { t2 = (a - 2); }
                    else
                    { t2 = n; }
                    if (i == 2 || i == 3)
                    {
                        Console.WriteLine(t2+" "+t1);
                    }
                    else
                    {
                        Console.WriteLine(t1+" "+t2);
                    }

                    n -= t2;
                }
            }
            if (g>5)
            {
                g = 5;
                int t1 = a;
                int z = Convert.ToInt32(t1 * g);
                int n1 = n;
                n = n - z;
                int t2;
                int dodato=0;
                long [,] skor = new long[5,2];
                for (int i = 0; i < g; i++)
                {
                    if (n >= a - 2)

                    { t2 = (a - 2); }
                    else
                    { t2 = n; }
                    skor[i, 0] = t1;
                    skor[i, 1] = t2;
                    n -= t2;
                    dodato += t1 + t2;
                }
                int dodati = n1-dodato;
                skor[0, 0] += dodati;
                for (int i = 0; i < 5; i++)
                {
                    if (i == 2 || i == 3)
                    {
                        Console.WriteLine(skor[i, 1] + " " + skor[i, 0]);
                    }
                    else
                    {
                        Console.WriteLine(skor[i, 0] + " " + skor[i,1]);
                    }
                }

            }
        }
    }
}