#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main(){
	unsigned N,A,p1,p2,s,x,y;
	int i;
	scanf("%u%u",&N,&A);
	if(N<3*A)printf("-1");
	else if(N==3*A)printf("%u 0\n%u 0\n%u 0",A,A,A);
	else {
		x=(N-2*A)/2;
		if(N%2==0)	printf("%u 0\n%u 0\n%u %u",A,A,x+1,x-1);
		else printf("%u 1 \n%u 0 \n%u %u",A,A,x+1,x-1);
	}
	return 0;
}