#include <bits/stdc++.h>
using namespace std;
void End(int x){
cout <<x<<endl;
exit(0);
}
void Resi2(int n){
if(n%2==1)End(-1);
cout <<2<<" "<<0<<endl;
cout <<2<<" "<<0<<endl;
cout <<(n-6)/2+2<<" "<<(n-6)/2<<endl;
exit(0);
}
int main(){
int n,a;
cin >>n>>a;
if(n<3*a)End(-1);
if(a==2)Resi2(n);
bool Nep=n%2;
n-=Nep;
cout <<a<<" "<<Nep<<endl;
cout <<a<<" "<<0<<endl;
int rem=(n-2*a-2)/2;
if(rem+2<a){
    cout <<a<<" "<<(2*rem+2)-a<<endl;
    exit(0);
}
cout <<rem+2<<" "<<rem<<endl;


}