#include <bits/stdc++.h>

int main()
{
	long long n, a;
	scanf("%lld%lld", &n, &a);
	if((3 * a > n) || (a == 2 && n % 2 != 0)) return printf("-1"), 0;

	if(n - 3 * a >= a - 2)
	{
		bool one = false;
		if((n - 2) % 2 != 0) one = true;
		long long x = (n - 2) / 2;
		
		printf("%lld %lld\n", x - a + 2, x - a);
		printf("%lld %d\n", a, one ? 1 : 0);
		printf("%lld 0", a);
	}
	else printf("%lld 0\n%lld 0\n%lld %lld", a, a, a, n - 3 * a);
}