#include <iostream>
using namespace std;

int main()
{
    long long uk,gra;
    cin>>uk>>gra;
    if(uk<gra*3)
        cout<<-1;
    else{
        if(uk%2==0){
            cout<<gra<<" 0"<<endl;
            cout<<gra<<" 0"<<endl;
            uk=uk-gra*2;
            if(uk>=gra && uk<2*gra)
                cout<<gra<<" "<<uk-gra<<endl;
            if(uk>=2*gra)
                cout<<(uk+2)/2<<" "<<(uk-2)/2<<endl;
        }
        else{
            cout<<gra<<" 1"<<endl;
            cout<<gra<<" 0"<<endl;
            uk=uk-gra*2-1;
            if(uk>=gra && uk<2*gra)
                cout<<gra<<" "<<uk-gra<<endl;
            if(uk>=2*gra)
                cout<<(uk+2)/2<<" "<<(uk-2)/2<<endl;
        }
    }
}