#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 br=0,n,a;
	cin>>n>>a;
	if(n/a<3){
		cout<<-1;
	}
	else{
		if(n/a>4){
			for(int i=0;i<3;i++){
				if(i%2==0){
					cout<<a<<" "<<0<<endl;
				}
				else{
					cout<<0<<" "<<a<<endl;
				}
				br+=a;
			}
			//cout<<n<<" "<<br;
			if((n-br-a)%2==0){
				cout<<0<<" "<<a<<endl;
				br+=a;
			}
			else{
				cout<<1<<" "<<a<<endl;
				br=br+a+1;
			}
			int x,y;
			x=(n-br)/2-1;
			y=(n-br)/2+1;
			cout<<x<<" "<<y;
		//	cout<<n;
		}
		else if(n/a==4 and n%a>0){
			for(int i=0;i<3;i++){
				if(i%2==0){
					cout<<a<<" "<<0<<endl;
				}
				else{
					cout<<0<<" "<<a<<endl;
				}
				br+=a;
			}
			cout<<(n-br-a)<<" "<<a;
		}
		else if(n/a==4 and n%a==0){
			cout<<a<<" "<<0<<endl;
			cout<<0<<" "<<a<<endl;
			cout<<a<<" "<<0<<endl;
			cout<<a<<" "<<0<<endl;
		}
		else if(n/a==3 and n%a==0){
			cout<<a<<" "<<0<<endl;
			cout<<a<<" "<<0<<endl;
			cout<<a<<" "<<0<<endl;
		}
		else if(n/a==3 and n%a>0){
			cout<<a<<" "<<0<<endl;
			cout<<a<<" "<<0<<endl;
			cout<<a<<" "<<(n-3*a);
		}
		
	}
	
	return 0;
}