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

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int a = int.Parse(Console.ReadLine());
            int[] p = new int[5];
            int[] z = new int[5];
            int i = 0;
            if (n < 3 * a)
                Console.WriteLine(-1);
            else
            {
                while (n > 0)
                {
                    if (n > a && i < 3)
                    {
                        p[i] = a;
                        z[i] = 0;
                        n -= a;
                    }
                    else
                    {
                        p[i - 3] = 0;
                        z[i - 3] = a;
                        if (n % 2 == 0)
                        {
                            p[i] = n / 2 + 1;
                            z[i] = n / 2 - 1;
                        }
                        else
                        {
                            p[i] = (n - 1) / 2 + 1;
                            z[i] = (n - 1) / 2 - 1;
                            z[i - 1]++;
                        }
                        n = 0;
                    }

                    i++;

                }
                for (int j = 0; j < i; j++)
                {
                    Console.WriteLine(p[j] + "  " + z[j]);
                }
            }
            Console.ReadLine();
        }
    }
}