#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
	int a,n,x,nula;
	nula=0;
	
	scanf("%d %d",&n,&a);
	
	
	if(n<3*a){
		printf("-1");
	}else{
		
		
		if(n%2==0){
			if(n<4*a-1){
				printf("%d %d",a,nula);
				cout<<endl;
				printf("%d %d",a,nula);
				cout<<endl;
				printf("%d %d",a, n-3*a);
				
			}else{
				printf("%d %d",a,nula);
				cout<<endl;
				printf("%d %d",a,nula);
				cout<<endl;
				printf("%d %d",(n-2*a)/2+1,(n-2*a)/2-1);
			}
		}else{
			if(n<4*a-1){
				printf("%d %d",a,nula);
				cout<<endl;
				printf("%d %d",a,nula);
				cout<<endl;
				printf("%d %d",a, n-3*a);
				
			}else{
				printf("%d %d",a,nula);
				cout<<endl;
				printf("%d %d",a,nula+1);
				cout<<endl;
				printf("%d %d",((n-1)-2*a)/2+1,((n-1)-2*a)/2-1);
			}
		}
	}
	
	
}