#include <iostream>

int main()
{
	int N, A;
	scanf("%d%d", &N, &A);
	if(N<3*A)
	{
		printf("-1");
		return 0;
	}
	int ostatak = 0;
	N-=2*A;
	int raz = N/2;
	printf("%d %d\n%d %d\n%d %d", A, N-2*raz, A, 0, raz+1, raz-1);
	return 0;
}