#include <iostream>
#define ll long long
using namespace std;
int main()
{
	ll n, a;
	cin >> n >> a;
	if(n < 3 * a) cout << -1;
	else if(n == 3 * a) cout << a << " 0\n" << a << " 0\n" << a << " 0";
	else
	{
		cout << a << " 0\n";
		if((n - 2 * a) % 2 == 0) cout << a << " 0\n";
		else cout << a << " 1\n";
		n -= 2 * a;
		n -= n % 2;
		if(n < 2 * a - 2) cout << a << " " << n - a;
		else cout << n / 2 + 1 << " " << n / 2 - 1;
	} 
}