#include<bits/stdc++.h>
using namespace std;
int main()
{
	int suma,a,a1,a2,a3,b1,b2,b3;
	cin>>suma>>a;
	suma=suma-2*a;
	if(suma<a) cout<<-1;
	else 
	{
		a1=a;
		b1=0;
		a2=a;
		b2=0;
		if(suma%2==0)
		{
			if(suma<2*a) 
			{
			a3=10;
			b3=suma-a;
			}
			else 
			{
			a3=suma/2+1;
			b3=suma/2-1;
			}
		}
		else 
		{
			if(suma<=2*a-3)
			{
			a3=a;
			b3=suma-a;
			}
			else
			{
				b1=1;
				suma--;
				a3=suma/2+1;
				b3=suma/2-1;
			}
		}
	cout<<a1<<" "<<b1<<endl;
	cout<<a2<<" "<<b2<<endl;
	cout<<a3<<" "<<b3<<endl;
	}
}