#include <iostream>
#include <vector>
using namespace std;

int main()
{
	int totalScore;
	int winScore;
	int remainder;
	int b2flag = 0;
	typedef vector<vector<int>> intMatrix;
	vector<int> x(2);
	intMatrix output(3, x);

	cin >> totalScore;
	cin >> winScore;

	if (totalScore < 3 * winScore) { //Ispod donje granice moguceg
		cout << -1;
	}



	if (totalScore <= 6*(winScore-1) && totalScore >= 3*winScore) { //Algoritam A
		
		for (int i = 0; i < 3; i++) { //Inicijalizovanje
			output[i][0] = winScore;
			output[i][1] = 0;
		}

		remainder = totalScore - 3 * winScore;

		if (winScore - 2 >= remainder) {
			output[2][1] = remainder;
		}
		else {
			output[2][1] = winScore - 2;
			remainder = remainder - (winScore - 2);

			if (winScore - 2 >= remainder) {
				output[1][1] = remainder;
			}
			else {
				output[1][1] = winScore - 2;
				remainder = remainder - (winScore - 2);
				output[0][1] = remainder;
			}
		}

		for (int i = 0; i < 3; i++) { //Output blok
			for (int j = 0; j < 2; j++) {
				cout << output[i][j] << " ";
			}
			cout << endl;
		}
	}


	if (totalScore > 6 * (winScore - 1) && winScore > 2) { //Algoritam B1

		for (int i = 0; i < 2; i++) { //Inicijalizovanje
			output[i][0] = winScore;
			output[i][1] = 0;
		}

		remainder = totalScore - 2 * winScore;
		
		if (remainder % 2 == 0) {
			output[2][0] = (remainder / 2) + 1;
			output[2][1] = (remainder / 2) - 1;
		}
		else {
			output[0][1] = 1;
			output[2][0] = ((remainder - 1) / 2) + 1;
			output[2][1] = ((remainder - 1) / 2) - 1;
		}

		for (int i = 0; i < 3; i++) { //Output blok
			for (int j = 0; j < 2; j++) {
				cout << output[i][j] << " ";
			}
			cout << endl;
		}


	}

	if (totalScore > 6 * (winScore - 1) && winScore <= 2) { //Algoritam B2

		for (int i = 0; i < 2; i++) { //Inicijalizovanje
			output[i][0] = winScore;
			output[i][1] = 0;
		}

		remainder = totalScore - 2 * winScore;

		if (remainder % 2 == 0) {
			output[2][0] = (remainder / 2) + 1;
			output[2][1] = (remainder / 2) - 1;
			b2flag = 1;
		}
		else {
			cout << -1;
		}

		if (b2flag == 1) {
			for (int i = 0; i < 3; i++) { //Output blok
				for (int j = 0; j < 2; j++) {
					cout << output[i][j] << " ";
				}
				cout << endl;
			}
		}

	}





}