#include<stdio.h>
unsigned long N, A, b=0,r;
int main(){
	scanf("%lu%lu",&N,&A);
	if(N/A<3)printf("-1");
	else {
		r=(N-3*A);
		if(r-3*A<1)printf("%lu %lu\n%lu %lu\n%lu %lu\n",A,r/3,A,r/3,A,r/3+r%3);
		else{
			printf("%lu %lu\n",A,A-6);
			r-=(long)A+6;
			if((A+r)%2==0){
				printf("%lu %lu\n",A,A-4);
				r-=(long)A+4;
			}
			else{
				printf("%lu %lu\n",A,A-3);
				r-=(long)A+3;
			}
			if(r>=A-2)printf("%lu %lu\n",(A+r-2)/2+2,(A+r-2)/2);
			else printf("%lu %lu\n",A,r);
		}
 	}
}