#include <iostream>

using namespace std;

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

    }
    if(n<(4*a-1)){
        cout<<a<<' '<<0<<endl;
        cout<<a<<' '<<0<<endl;
        cout<<a<<' '<<n-3*a<<endl;
        return 0;
    }

    cout<<a<<' '<<0<<endl;
    cout<<a<<' '<<n%2<<endl;
    if(n%2) n--;
    n=n-(2*a);
    n=n-2;
    n=n/2;
    cout<<n+2<<' '<<n<<endl;
    return 0;
}