#include <cstdio>


int main()
{
	using u32 = unsigned int;

	u32 n, a;

	std::scanf("%u %u", &n, &a);

	int sum = n - 6 * a + 6;

	if (sum < 0)
	{
		std::puts("-1");
		return 0;
	}

	int k1, k2;
	if (sum & 1)
	{
		k1 = 1;
		k2 = (sum - k1) / 2;
	}
	else
	{
		k1 = sum / 2;
		k2 = 0;
	}

	std::printf("%d %d\n%d %d\n%d %d\n", 
				a + k1, a + k1 - 2,
				a + k2, a + k2 - 2,
				a     , a - 3);
}