#include <iostream>

using namespace std;
int main(){

int64_t N,A,brojsetova,preostalipoeni,i,f,g;
cin >> N >> A;

brojsetova=(N-(N%A))/A;
preostalipoeni=N-(brojsetova*A);
i=0;
f=0;

if (N<3*A | N==0 | A==0 | N==A | A>N ){
    cout << "-1";
}
else if (N>A*5 && N<A*6){
cout << preostalipoeni/2 << " " << A << endl;
cout << preostalipoeni/2 << " " << A << endl;
while (f<(brojsetova-1)){
    cout << 0 << " " << A << endl;
    f++;
}
}
else if (N>A*6 && N<A*7){
cout << A << " " << preostalipoeni/3 << endl;
cout << preostalipoeni/3 << " " << A << endl;
cout << preostalipoeni/3 << " " << A << endl;
while (g<(brojsetova-1)){
    cout << 0 << " " << A << endl;
    g++;
}



}




else {



cout << A << " " << preostalipoeni << endl;
while (i<(brojsetova-1)){
    cout << 0 << " " << A << endl;
    i++;
}
}








return 0;
}