#include <iostream>

using namespace std;

int main()
{
 int N,A;
 cin>>N>>A;
int ostatak = N - 2 * A;
int p;
int q;
q = p-2;
p = ostatak/2 + 1;
q = ostatak/2 - 1;
bool parN = N % 2;
if (N < 3 * A || p < 2 || A < 2){
    cout<<-1;
    return 0;
}
else if(ostatak < 2*A - 2){
cout<<A<<" "<<0<<endl<<A<<" "<<0<<endl<<A<<" "<<ostatak - A;
}
else if(ostatak > 2*A - 2 && !parN) {
    cout<<A<<" "<<0<<endl<<A<<" "<<0<<endl<<p<<" "<<q;
}
else if(ostatak == 2*A - 2){
    cout<<A<<" "<<0<<endl<<A<<" "<<0<<endl<<A<<" "<<A-2;
}
else {
    ostatak--;
    cout<<A<<" "<<1<<endl<<A<<" "<<0<<endl<<p<<" "<<q;
}
    return 0;
}