#include <iostream>
using namespace std;

int main() {
	int a, n;
	int al, ad, bl, bd, cl, cd;
	int dvak = 0;
	cin>>n>>a;
	if(n<(3*a)) cout<<"-1";
	else if(a==2&&n%2==1) cout<<"-1";
	else
	{
		al = bl = a;
		ad = bd = a-2;
		dvak = n + 6 - 6*a;
		if(n%2==1)
		{
			bd--;
			dvak++;
		}
		cl = a + dvak/2;
		cd = a + dvak/2 - 2;
		cout<<al<<" "<<ad<<endl;
		cout<<bl<<" "<<bd<<endl;
		cout<<cl<<" "<<cd<<endl;
	}	
}