#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	
	long long n,a;
	cin>>n>>a;
	
	if(n<3*a)
	{
		cout<<"-1";
		return 0;
	}
	if(n<=4*a-2)
	{
		cout<<a<<" 0\n";
		cout<<a<<" 0\n";
		cout<<a<<" "<<n-3*a;
		return 0;
	}
	if(n%2==0)
	{
		cout<<a<<" 0\n";
		cout<<a<<" 0\n";
		ll prvi=a;
		ll drugi=a-2;
		n-=4*a-2;
		prvi+=n/2;
		drugi+=n/2;
		cout<<prvi<<" "<<drugi<<"\n";
		return 0;
	}
	if(n%2==1)
	{
		cout<<a<<" 0\n";
		cout<<a<<" 1\n";
		ll prvi=a;
		ll drugi=a-2;
		n-=4*a-1;
		prvi+=n/2;
		drugi+=n/2;
		cout<<prvi<<" "<<drugi<<"\n";
		return 0;
	}
	return 0;
}