using System;
class Program
{
    static void Main()
    {
        string[] s=Console.ReadLine().Split();
        int n=int.Parse(s[0]);
        int a=int.Parse(s[1]);
        int p1=a,p2=0,k=-1,p;
        if(n>=3*a)
        {   
            if(n%2==0)
        {
            Console.WriteLine("{0} {1}",p1,p2);
            Console.WriteLine("{0} {1}",p1,p2);
            p=n-2*a;
            if(p==a)
            {
                Console.WriteLine("{0} {1}",p1,p2);
            }
            if(p<2*a)
            {p2=p-a;
                Console.WriteLine("{0} {1}",p1,p2);
            }
            if(p>=2*a)
            {p1=p/2+1;p2=p/2-1;
                Console.WriteLine("{0} {1}",p1,p2);
            }
        }
            
            else
            {
                
                Console.WriteLine("{0} {1}",p1,p2);
                p2=1;
                Console.WriteLine("{0} {1}",p1,p2);
                p=n-2*a-1;
                if(p==a){p2=0;Console.WriteLine("{0} {1}",p1,p2);}
                if(p<2*a){p1=a;p2=p-a;Console.WriteLine("{0} {1}",p1,p2);}
                if(p>=2*a){p1=p/2+1;p2=p/2-1;Console.WriteLine("{0} {1}",p1,p2);}
           
            }
            
            
            
        }
        else
        {
            Console.WriteLine("{0}",k);
        }
    }
}