#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int a,n,broj=0;
    int neparan=0;

    cin>>n>>a;

    if((a==2)and(n%2==1))
    {
        cout<<-1<<endl;
    }
    else if(n<3*a)
    {
        cout<<-1<<endl;
    }
    else
    {
       if((n-2*a)%2==1)
       {
           n=n-1;
           neparan=1;
       }
        if(n>=4*a)
        {
            broj=(n/2)-a+1;
            cout<<broj<<" "<<broj-2<<endl;
            cout<<a<<" "<<neparan<<endl;
            cout<<a<<" "<<0<<endl;
        }
        else
        {
            broj=n-(3*a);
            cout<<a<<" "<<broj<<endl;
            cout<<a<<" "<<neparan<<endl;
            cout<<a<<" "<<0<<endl;
        }
    }



    return 0;
}