#include <stdio.h>
#include <stdlib.h>
int main() {
	long long  n,a,x;
	scanf("%lli%lli",&n,&a);
	if(n/a<3||a<=1){
		printf("-1");
		exit(1);
		}
	x=n-2*a;
	if(a==2&&n%2==0){
		printf("-1");
		exit(1);
	}
	
	if(x%2==0)
		printf("%lli %lli",a,0);
	else 
		printf("%lli %lli",a,1);
		printf("\n%lli %lli",a,0);
		
	if(x>=2*a){
		if(x%2==0)
			printf("\n%lli %lli",x/2+1,x/2-1);
		else 
			printf("\n%lli %lli",(x+1)/2,(x+1)/2-2);
    }
    
	else {
			printf("\n%lli %lli",a,x-a);
	}
	return 0;
}