#include <iostream>
using namespace std;

int main()
{
	unsigned long A,N;
	cin >> N >> A;
	double n0=(1.0*N)/(2.0*A-2.0)+0.9;
	unsigned long n0set=(int)(n0);
	if(n0set<=3)
	{
		n0set=3;
	}
	else
	{
		if(n0set>=5)
		{
			n0set=5;
		}
		else
		{
			n0set=4;
		}
	}
	//cout << "n0set = " << n0set << " n0 = " << n0 << endl;
	unsigned long Ym=(N-2*A)/(2*(n0set-1));
	unsigned long Xm=Ym+2;
	unsigned long d=A-Xm;
	//cout << "Ym = " << Ym << " Xm = " << Xm << " d= " << d << endl;
	if( (N >= 3*A) && ( N<4*A))
	{
		Xm=A;
		Ym=0;
	}
	
	if(Xm<A && Ym-d>=0)
	{
		Xm=A;
		Ym=Ym-d;
	}
	unsigned long Yk=N-(n0set-1)*(Xm+Ym)-A;
	unsigned long Xk=A;
	if(Yk>Xk)
	{
		unsigned long p=Xk+Yk;
		if(p%2==0)
		{
			Xk=(p+2)/2;
			Yk=Xk-2;
		}
	}
	if(Xk==Yk)
	{
		Xk=Xk+1;
		Yk=Yk-1;
	}
	//cout << Xm << ":" << Ym << ":" << Xm+Ym << endl;
	//cout << Xk << ":" << Yk << ":" << Xk+Yk << endl;
	long R[n0set][2];
	R[0][0]=Xk;
	R[0][1]=Yk;
	for(int i=1;i<n0set;i++)
	{
		if((i%2==0) && (n0set>3))
		{
			R[i][0]=Ym;
			R[i][1]=Xm;
		}
		else
		{
			R[i][0]=Xm;
			R[i][1]=Ym;	
		}
	}
	if(N<3*A)
	{
		cout << "-1" << endl;
	}
	else
	{
		for(int i=1;i<n0set;i++)
		{
			cout << R[i][0] << " " << R[i][1] << endl;
		}
		cout << R[0][0] << " " << R[0][1] << endl;
	}
}