#include <iostream>

int main(int argc, char** argv) {
	unsigned long long N, A;
	scanf("%llu %llu", &N, &A);
	if(3 * A > N) {
		printf("-1");
		return 0;
	}
	unsigned long long arrRezPoSetovima[3][2];
	arrRezPoSetovima[1][0] = A;
	arrRezPoSetovima[1][1] = 0;
	arrRezPoSetovima[2][0] = A;
	arrRezPoSetovima[2][1] = 0;
	N -= 2 * A;
	if(N % 2 == 0) {
		arrRezPoSetovima[0][0] = N / 2 + 1;
		arrRezPoSetovima[0][1] = N / 2 - 1;
	}
	else {
		arrRezPoSetovima[0][0] = (N - 1) / 2 + 1;
		arrRezPoSetovima[0][1] = (N - 1) / 2 - 1;
		arrRezPoSetovima[1][1] = 1;		
	}
	printf("%llu %llu\n", arrRezPoSetovima[0][0], arrRezPoSetovima[0][1]); 		
	printf("%llu %llu\n", arrRezPoSetovima[1][0], arrRezPoSetovima[1][1]); 		
	printf("%llu %llu"  , arrRezPoSetovima[2][0], arrRezPoSetovima[2][1]); 		
	return 0;
}