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

namespace Zadatak_2
{
    class Odbojka
    {
        BigInteger N;
        long A,brojSetova;
        public Odbojka()
        {
            string[] input = Console.ReadLine().Split(' ');
            N = Convert.ToInt64(input[0]);
            A = Convert.ToInt64(input[1]);
            brojSetova = (int)(N / (long)A);
            if (brojSetova > 5) brojSetova = 5;
        }
        public bool Provera()
        {
            if (brojSetova < 3)
            {
                Console.WriteLine("-1");
                return false;
            }
            return true;
        }
        public void Set()
        {
            while (brojSetova!=0)
            {
                BigInteger Iskoristiti = new BigInteger();
                Iskoristiti= N - (long)(brojSetova - 1) * A;
                if (Iskoristiti > 2 * (A - 1))
                {
                    Console.WriteLine("{0} {1}", ((brojSetova > 3) ? (Iskoristiti / 2 - 1) : Iskoristiti / 2 + 1),
                        ((brojSetova > 3) ? (Iskoristiti / 2 + 1) : Iskoristiti / 2 - 1));
                    N -= (Iskoristiti / 2 + Iskoristiti / 2);
                }
                else
                {
                    Console.WriteLine("{0} {1}", ((brojSetova > 3) ? (Iskoristiti - A) : A),
                        ((brojSetova > 3) ? (A) : Iskoristiti - A));
                    N -= Iskoristiti;
                }
                brojSetova--;
            }
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Odbojka Nesto = new Odbojka();
            if (Nesto.Provera())
            {
                Nesto.Set();
            }
        }
    }
}