#include <iostream>

using namespace std;
int N, A;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>N>>A;
    if(N<3*A)
    {
        cout<<-1<<endl;
    }
    else
    {
        int p=(N+2)%(2*A);
        int x=p/2,y=p/2+p%2;
        int z=(N+2-x-y)/(2*A)-1;
        if(z==0)
        {
            cout<<A<<" "<<(x+y-A-2)/2 + (x+y-A-2)%2<<endl;
            cout<<A<<" "<<(x+y-A-2)/2<<endl;
            cout<<A<<" "<<0<<endl;
        }
        else
        {
            cout<<A<<" "<<x<<endl;
            cout<<A<<" "<<y<<endl;
            cout<<z*A<<" "<<z*A-2<<endl;
        }
    }
    return 0;
}