#include <iostream>

using namespace std;

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

}