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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] niz = Console.ReadLine().Split();
            int n = int.Parse(niz[0]);
            int a = int.Parse(niz[1]);            
            int bs = n / (a+a-2);            
            if (bs < 3) Console.WriteLine("-1");
            if (bs > 3 || bs==3)
            {
                if(n%2==0)
                {
                    Console.WriteLine(a+" "+(a-2));
                    Console.WriteLine(a+" "+(a-2));
                    int s = n-2*(2*a-2);
                    Console.WriteLine((s/2+1)+" "+(s/2-1));
                }
                }
                if (n % 2 == 1)
                {
                    Console.WriteLine(a+" "+(a-2));
                    Console.WriteLine(a+" "+(a-3));
                    int s = n-2*(2*a-2)+1;
                    Console.WriteLine((s/2+1)+" "+(s/2-1));
                }
            }
        }
    }