#include<iostream>
using namespace std;

unsigned N, A, raz;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	cin >> N >> A;
	if (N<3*A) cout << "-1";
	else if (N==3*A) {
		cout << A << " 0" << endl;
		cout << A << " 0" << endl;
		cout << A << " 0";
	}
	else {
		raz = N - 2*A;
		if (raz%2==0) {
			if (raz >= 2*A) {
				cout << A << " 0" << endl;
				cout << A << " 0" << endl;
				cout << raz/2+1 << " " << raz/2-1;
			}
			else if (raz < 2*A && raz >= A) {
				cout << A << " 0" << endl;
				cout << A << " 0" << endl;
				cout << A << " " << raz-A; 
			}
			else if (raz < A) {
				cout << A << " 0" << endl;
				cout << A << " " << raz/2 << endl;
				cout << A << " " << raz/2;
			}
		}
		else {
			if (raz >= 2*A) {
				cout << A << " 1" << endl;
				cout << A << " 0" << endl;
				cout << (raz-1)/2+1 << " " << (raz-1)/2-1;
			}
			else if (raz < 2*A && raz >= A) {
				cout << A << " 1" << endl;
				cout << A << " 0" << endl;
				cout << A << " " << (raz-1)-A; 
			}
			else if (raz < A) {
				cout << A << " 1" << endl;
				cout << A << " " << (raz-1)/2 << endl;
				cout << A << " " << (raz-1)/2;
			}
		}
	}
}