#include<stdio.h>
#include<math.h>
int main()
{
	long long int n,a,p1,p2,k,set1;
	scanf("%lld",&n);
	scanf("%lld",&a);
	if(n - 3*a < 0)
	{
		printf("%d",-1);
	}
	else
	{
		k = 1;
		while(k < 3)
		{
			if(k == 2 && n % 2 == 1)printf("%d %d\n",a,1);
			else printf("%d %d\n",a,0);
			k++;
		}
		if(n%2==0)n = n - 2*a;
		else n = n - 2*a - 1;
		if(a*2 - n == 0)printf("%d %d\n",a+1,a-1);
		else if(n < 2 * a)printf("%d %d\n",a,n-a);
		else printf("%d %d\n",n/2+1,n/2-1);
	}
}