#include <iostream>

using namespace std;

void rezultat(long long N, long long A) {

}

int main() {
	long long N, A, x, y;
	cin >> N >> A;
	//rezultat(N, A);
	if (3 * A > N) cout << "-1";
	else {
		long long pom = N - 2 * A;
		if (pom % 2 == 0) {
			x = (N - (2 * A) - 2) / 2;
			y = x + 2;
			cout << A << " " << "0" << endl;
			cout << A << " " << "0" << endl;
			cout << y << " " << x << endl;
		}
		else {
			x = (N - (3 * A) - 2) / 2;
			y = x + 2;
			cout << A << " " << "0" << endl;
			cout << A << " " << "0" << endl;
			cout << x << " " << y << endl;
			cout << A << " " << "0" << endl;
		}
	}
}