#include<bits/stdc++.h>
using namespace std;
long long n,a,prosek,levi,desni,zbirdonjih,ostatak;
int main()
{
    scanf("%lld %lld",&n,&a);
    if(n/3>a)
    {
        cout<<a<<" "<<"0"<<endl;
        if(n%2==0)
        {
            cout<<a<<" "<<"0"<<endl;
            ostatak=n-a-a;
        }
        else
        {
            cout<<a<<" "<<"1"<<endl;
            ostatak=n-a-a-1;
        }
        cout<<ostatak/2+1<<" "<<ostatak/2-1<<endl;
        return 0;
    }
    else
    {
        cout<<"-1"<<endl;
        return 0;
    }
    return 0;
}