#include<iostream>
using namespace std;

long L[3], D[3];
long A, N;
long ostatak;
int  i;
main(){
	ios::sync_with_stdio(false);
	cin >> N >> A;
	if (N/A < 3) cout << -1;
	else {
		L[0] = A;
		L[1] = A;
		L[2] = A;
		ostatak = N - 3*A;
		if(ostatak < A-1) D[0]+=ostatak;
		else {
			D[0]+=A-2;
			ostatak-=A-2;
			if(ostatak == 1){
				D[1]++;
			}
			else if(ostatak & 1){
				L[0]+=ostatak/2;
				D[0]+=ostatak/2;
				D[1]++;
			}
			else{
				L[0]+=ostatak/2;
				D[0]+=ostatak/2;
			}
		}
	}
		for(i;i<3;i++) cout << L[i] << ' ' << D[i] << '\n';
}