#include <iostream>

using namespace std;

int main(int argc, char** argv) {
	
	
	int n;
	int a;
	cin>>n;
	cin>>a;
	int b = n - 2*a;
	int c = b-1;
	if(a*3 > n){
		
		cout<<'-1';
	}
	else{
		
		if(b % 2 ==0){
			
			
			cout<<a<<' '<<'0'<<endl;
			cout<<a<<' '<<'0'<<endl;
			cout<<b/2 +1<<' '<<b/2 -1;
			
		}
		else{
			cout<<a<<' '<<'1'<<endl;	
			cout<<a<<' '<<'0'<<endl;
			cout<<c/2 +1<<' '<<c/2 -1;
		}
		
		
		
		
		
		
		

		
	}
	
	
	return 0;
}