#include<iostream>

using namespace std;

int n,a;

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

    return 0;
}