#include <iostream>

using namespace std;

int main()
{
    int N,A,a,b,a1,b1,broj,a2,b2;
   cin>>N>>A;
    if(N/A<3){
        cout<<-1;

    }
    else{
    a=A;
    b=A-2;

    a1=A;
    b1=0;

    broj=N-a-b-a1-b1;
    a2=broj-A;
    b2=A;
    while(a2>A+2){
        a=a+1;
        b=b+1;
        a1=a1+1;
        b1=b1+1;
    }
    cout<<a<<" "<<b<<endl<<a1<<" "<<b1<<endl<<a2<<" "<<b2<<endl;
    }













    return 0;
}