#include <iostream>
using namespace std;
int main()
{
	int n,a;
	cin >> n;
	cin >> a;
	if(n/a<3)
	{
		cout << "-1" << endl;
		return 0;
	}

	n-=2*a;
	int prenos;
	if(n%2==0)
	{
		prenos=0;
		int x=(n/2)+1;
		int y=(n/2)-1;
		if(x<a)
		{
			cout << "-1" << endl;
			return 0;
		}
		cout << x << " " << y << endl;
	}
	else
	{
		n-=1;
		prenos=1;
		int x=(n/2)+1;
		int y=(n/2)-1;
		if(x<a)
		{
			cout << "-1" << endl;
			return 0;
		}
		cout << x << " " << y << endl;
	}
	cout << a << " 0" << endl;
	cout << a << " " << prenos << endl;
	return 0;
}