#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a,x,y,r;
	cin>>n>>a;
	r=(n-2*a-n%2)/2; 
	x=r+1;
	y=r-1;
	if(x<a) cout<<-1<<endl;
	else{
		cout<<a<<" "<<n%2<<endl;
		cout<<a<<" "<<0<<endl;
		cout<<x<<" "<<y<<endl;
	}
}