#include <iostream>

using namespace std;

int main(int argc, char** argv) {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cerr.tie(0);
	
	int b, n;
	
	cin >> b >> n;
	
	if (b < n * 3 || b == 7){
		cout << -1 << endl;
	}
	else {
		cout << n << " 0" << endl;
		
		if ((b - n*2) % 2 == 0){
			cout << n << " 0" << endl;
			cout << 1+(b - n*2)/2 << " " << (b - n*2)/2 - 1 << endl;
		}
		else {
			cout << n << " 1" << endl;
			cout << 1+(b - n*2)/2 << " " << (b - n*2)/2 - 1 << endl;
		}
	}
	
	return 0;
}