#include <bits/stdc++.h>
using namespace std;
int A,N;
int main(){
       cin>>N>>A;
       //N UKUPAN BROJ POENA NA MECU
       //A MINIMALAN BROJ ZA SET
       if(N<3*A){cout <<-1<<endl;}
       else{if((N==3*A)and(N==3*A+1)){cout<< A<<" "<<0 <<endl;
                       cout <<A<<" "<<0<<endl;
                       cout <<A<<" " <<0<<endl;}
            else{

            cout << A<<" "<< 0<<endl;
             cout << A+1<<" " <<0+1<<endl;
             cout << A<<" " << 0<<endl;
                }
       }
return 0;
}