#include <iostream>
using namespace std;
int main()
{
    long long int a,n,s11,s12,s21,s22,s31,s32,ostatak;
    cin >>n;
    cin>>a;

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

    s11=a;
    s12=0;
    s21=a;
    s22=0;
    s31=a;
    s32=0;
    ostatak=n-3*a;
    if(ostatak < a-1)
    {
        s32 = ostatak;
    }
    else
    {
        ostatak=n-2*a;
        if (ostatak%2==0)
        {
            ostatak/=2;
            s31=ostatak+1;
            s32=ostatak-1;
        }
        else
        {
            s22++;
            ostatak=ostatak-1;
            s31=ostatak/2+1;
            s32=ostatak/2-1;
        }
    }
    cout <<s11<<" "<<s12<<endl;
    cout <<s21<<" "<<s22<<endl;
    cout <<s31<<" "<<s32<<endl;
    return 0;
}