#include <iostream>

using namespace std;

int main()
{
    int n,a;
    cin>>n>>a;
    int a1=a;
    int a2=a;
    int a3=a;
    int b1=0;
    int b2=0;
    int b3=0;
    int r=n-3*a;
    if(r<0)
        cout<<-1<<endl;
    else
    {
        while(a1-2 > b1)
        {
            b1+=1;
            r-=1;
        }
        if(r%2 == 1)
        {
            b2+=1;
            r-=1;
        }
        while(r>0)
        {
            b1+=1;
            a1+=1;
            r-=2;
        }
        cout<<a1<< " " <<b1<<endl;
        cout<<a2<< " " <<b2<<endl;
        cout<<a3<< " " <<b3<<endl;
    }
    return 0;
}