#include <bits/stdc++.h>
using namespace std;
int main(){
unsigned long long a, n;
cin>>n>>a;
if(n/a<3){
    cout<<"-1";
    return 0;
}
int set1P,set2P,set3P,set1Z,set2Z,set3Z;
set1P=set2P=a;
set1Z=0;
n-=2*a;
if(n%2==0){
    set2Z=0;
    set3P=n/2+1;
    set3Z=n/2-1;
}
else{
    set2Z=1;
    n--;
    set3P=n/2+1;
    set3Z=n/2-1;

}
cout<< set1P<<" "<<set1Z<<endl<<set2P<<" "<<set2Z<<endl<<set3P<< " "<<set3Z<<endl;



}