#include<stdio.h>
#include<stdlib.h>
int main()
{
	int A,N,x,y;
	scanf("%d%d",&N,&A);
	double s=(float)N/3;
	if(s<A)
	{
		printf("-1");
		return 0;
	}
	printf("%d 0\n",A);
	if(N%2==0)
	{   
	    printf("%d 0\n",A);
		N=N/2;
		x=N-A+1;
    }
	else
	{  
	    printf("%d 1\n",A);
		N=(N+1)/2;
		x=N-A;
	}
	y=x-2;
    if(x<A)
    {
    	y-=A-x;
    	x=A;
	}
	
	printf("%d %d",x,y);
	return 0;
	
}