#include <iostream>

int max(int a, int b) {
	if (a > b)
		return a;
	return b;
}

int main() {
	std::ios_base::sync_with_stdio(false);

	//N - ukupan broj poena u mecu   A - minimalni broj poena da bi se dobio set
	int N, A;
	std::cin >> N >> A;

	if (N < max(3 * A, 6)) {
		std::cout << -1;

		return 0;
	}

	int N1, N2;

	N1 = N - max(3 * A, 6);
	if (N1 % 2 == 1) N1--;
	if (N1 / 2 + 1 < A) N1 = 0;
	N2 = N - N1;

	if (N2 % A > A - 2) {
		std::cout << -1;

		return 0;
	}

	if (N1 != 0) std::cout << N1 / 2 + 1 << " " << N1 / 2 - 1 << std::endl;
	std::cout << N2 / 3 << " 0" << std::endl;
	std::cout << N2 / 3 << " 0" << std::endl;
	std::cout << N2 / 3 << " " << N2 % 3 << std::endl;

	return 0;
}