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

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	long long n, a;
	int s = 3, sum;
	cin >> n >> a;

	if(n < 3*a) {
		cout << -1;
		return 0;
	}
	long long r[10] = {a,0,a,0,a,0};
	sum = 3*a;
	if(n-sum > a-3){
		r[1] += a-3;
		sum += a-3;
		if((n-sum)%2 == 0){
			r[3]++;	
			sum++;
		}
		r[0] += (n-sum)/2;
		r[1] += (n-sum)/2 + 1;
	}else r[1] += n-sum;

	cout << r[0] << " " << r[1] << "\n";
	cout << r[2] << " " << r[3] << "\n";
	cout << r[4] << " " << r[5];
	return 0;
}