#include <iostream>

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