#include <bits/stdc++.h>
#define ll long long 			//-+ 9,223,372,036,854,775,807  = 9.2*10^18 = 2^63 - 1
#define ull unsigned long long	// +18,446,744,073,709,551,615  = 1.8*10^19 = 2^64 - 1
#define l long					//-+ 			 2,147,483,647	= 2.1*10^9  = 2^31 - 1
#define ul unisgned long		// +			 4,294,967,295	= 4.3*10^9	= 2^32 - 1
#define db double
#define ldb long double
#define ff(i,n) for(int i = 0; i < n; ++x)
#define fff(i,a,b) for(int i = a; i<=b; ++i)

using namespace std;


ll a=0, n=0;

int main(){
	cin>>n;
	cin>>a;
	ll total = n;
	ll quotient = a;
	
	
		if(total<3*a){
			cout<<-1;
		}
		else if(total>=3*a && total <3*a+(a-1)){
			cout<<a<<" "<<total-(3*a)<<endl;
			cout<<a<<" "<<0<<endl;
			cout<<a<<" "<<0<<endl;
			}
		else if(total>=3*a+(a-1) && total <3*a+2*(a-2)+1){
			int rest=total-3*a;
			cout<<a<<" "<<a-2<<endl;;
			rest=rest-(a-2);
			cout<<a<<" "<<rest<<endl;
			cout<<a<<" "<<0<<endl;
			}
		else if(total>=3*a+2*(a-2)+1 && total <3*a+3*(a-2)+1){
			int rest=total-3*a-2*(a-2);
			cout<<a<<" "<<a-2<<endl;;
		
			cout<<a<<" "<<a-2<<endl;
			cout<<a<<" "<<rest<<endl;
			}
			else if(total>3*a+3*(a-2) && total%2==1){
			cout<<a<<" "<<a-3<<endl;;
		
			cout<<a<<" "<<a-2<<endl;
			int rest=total-4*a + 5;
			int teama=rest/2+1;
			int teamb=rest/2-1;
			cout<<teama<<" "<<teamb<<endl;
			}
			else if(total>3*a+3*(a-2) && total%2==0){
			cout<<a<<" "<<a-2<<endl;;
		
			cout<<a<<" "<<a-2<<endl;
			db rest=total-4*a + 4;
			int teama=rest/2+1;
			int teamb=rest/2-1;
			cout<<teama<<" "<<teamb<<endl;
			}		
				
			
			
		
	return 0;
		
	}