#include <iostream>

using namespace std;

int main() {
	unsigned long long int n;
	unsigned long long int a;
	
	cin >> n>>a;
	
	if (n/3 < a ){
		cout << -1;
	} else {
		cout<< a << ' '<<(n-2*a) % 2 << endl;
		cout<< a << ' '<< 0 << endl ;
		cout<< (n-2*a)/2+1 << ' '<< (n-2*a)/2-1;
	}

}