#include<stdio.h>
#include<stdlib.h>
int main()
{
	int A,N,x,y;
	scanf("%d%d",&N,&A);
	if(N<3*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;
	printf("%d %d",x,y);
	
}