#include <cstdio>

long long X, C;

long long abs(long long x) {
	if (x < 0) {
		return -x;
	} else {
		return x;
	}
}

int main() {

	scanf("%lld%lld", &X, &C);
	if (X >= 3 * C) {
		if (X - (3 * C) > C - 2) {
			if (abs((X - (3 * C)) - C) % 2 == 0) {
				printf("%lld 0\n%lld 0\n%lld %lld\n", C, C, (X - (2 * C) + 2) / 2, (X - (2 * C) - 2) / 2);
			} else {
				if (C > 2) {
					printf("%lld 1\n%lld 0\n%lld %lld\n", C, C, (X - (2 * C) + 1) / 2, (X - (2 * C) - 3) / 2);
				} else {
					printf("-1\n");
				}
			}
		} else {
			printf("%lld 0\n%lld 0\n%lld %lld\n", C, C, C, X - (3 * C));
		}
	} else {
		printf("-1\n");
	}
	return 0;
}