#include <iostream>
using namespace std;
int main(){

int64_t N,A,set1,ostatak;
cin >> N >> A;

if (3*A>N | N==A | A==0 | N==0){
    cout << "-1";
}
else{
set1=(N-(2*A))/2;
ostatak=(N-(2*A))%2;

cout << set1+1 << " " << set1-1 << endl;
cout << A << " " << ostatak << endl;
cout << A << " " << 0;
}



return 0;
}