#include <bits/stdc++.h>
using namespace std;

void neparno(int n, int a){
	cout << a << " " << 0 << endl;
	cout << a << " " << 1 << endl;
	n -= 2 * a;
	n--;
	n /= 2;
	cout << n + 1 << " " << n - 1;
}

void parno(int n, int a){
	cout << a << " " << 0 << endl;
	cout << a << " " << 0 << endl;
	n -= 2 * a;
	n /= 2;
	cout << n + 1 << " " << n - 1;
}

int main() {
	
	int n, a;
	cin >> n >> a;

	if(3 * a > n){
		cout << -1 << endl;
		return 0;
	}

	if(n % 2 == 0){
		parno(n, a);
	}else {
		neparno(n, a);
	}

	return 0;
}