#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	long long n,A;
	cin>>n>>A;
	if(n<3*A || n==A)
	{
		cout<<-1;
		exit(0);	
	}
	int a[2]={A,0};
	int b[2]={A,0};
	int c[2]={A,0};
	n=n-(3*A);
	if(n<2*A)
	{
		int d[2]={0,n};
		
		cout<<a[0] ;
		cout<<" "<< a[1]<<endl;
		
		cout<<b[0] ;
		cout<<" "<< b[1]<<endl;
		
		cout<<d[0] ;
		cout<<" "<< d[1]<<endl;

		cout<<c[0] ;
		cout<<" "<< c[1]<<endl;
		exit(0);
	}
	
	else
	{
		if(n%2==0)
		{
			int e[2]={0,n/2};
			int f[2]={0,n/2};
			
			cout<<a[0] ;
		    cout<<" "<< a[1]<<endl;
		    
		    cout<<b[0] ;
	       	cout<< " "<<b[1]<<endl;
	       	
	       	cout<<e[0] ;
	       	cout<<" "<< e[1]<<endl;
	       	
	       	cout<<f[0] ;
	       	cout<<" "<< f[1]<<endl;
	       	
	       	cout<<c[0] ;
	       	cout<< " "<<c[1]<<endl;
	 
	         exit(0);
		}
		else
		{
			int g[2]={0,(n-1)/2};
			int h[2]={0,(n/2)+1};
			
			cout<<a[0] ;
		    cout<<" "<< a[1]<<endl;
		    
		    cout<<b[0] ;
	       	cout<<" "<< b[1]<<endl;
	       	
	       	cout<<g[0] ;
	       	cout<< " "<<g[1]<<endl;
	       	
	       	cout<<h[0] ;
	       	cout<< " "<<h[1]<<endl;
	       	
	       	cout<<c[0] ;
	       	cout<< " "<<c[1]<<endl;
	       	exit(0);
		}
	}
	return 0;
}