#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
	long n,a,ostatak;
	int i=0;
	cin>>n>>a;
	long r[6];
	long r2[6];
	ostatak=n;
	if(n<3*a)cout<<"-1"<<endl;
	else{
	
	if(n>=3*a && n<4*a){
		if(((n%2!=0) && (a%2==0))){
		ostatak=n-((2*a)+1);
		for(i=0;i<2;i++){
		r[i]=a;
		r2[i]=i;	
		}}
		else{
		ostatak=n-(2*a);
		for(i=0;i<2;i++){
		r[i]=a;
		r2[i]=0;	
		}
		}
		r[2]=a;
		ostatak-=a;
		r2[2]=ostatak;
	}
	if(n>=4*a){
		if(((n%2!=0) && (a%2==0))){
		ostatak=n-((2*a)+1);
		for(i=0;i<2;i++){
		r[i]=a;
		r2[i]=i;	
		}}
		else{
		ostatak=n-(2*a);
		for(i=0;i<2;i++){
		r[i]=a;
		r2[i]=0;	
		}
		}
		if(ostatak%2!=0){
			ostatak-=1;
			r2[1]=1;
		}
		r[2]=(ostatak/2)+1;
		ostatak-=r[2];
		r2[2]=ostatak;
		}		
}
	for(int j=0;j<=i;j++){
		cout<<r[j]<<" "<<r2[j]<<endl;
	}
	return 0;
}