#include <iostream>

using namespace std;

int main()
{
    int a,n,x,y;
    x=0;
    cin>>n>>a;
    y=a;
    //cout<<"y: "<<y<<endl;
    if(n >= 3 * a){
            //cout<<"usao if1"<<endl;
        if(n % 2 == 0){
            //cout<<"usao if2"<<endl;
            while(2*a + y + x != n)
            {
                //cout<<"usao while1"<<endl;
                while(x < a-2){
                    //cout<<"usao while2"<<endl;
                    if(3*a + x == n){
                            break;
                    }
                    else{x++;}
                }
                if(3*a + x == n){
                            break;
                    }
                //cout<<"izasao while2"<<endl;
                y++;
                x++;
            }
            //cout<<"izasao ehile1"<<endl;
            cout<<a<<" "<<"0"<<endl;
            cout<<a<<" "<<"0"<<endl;
            cout<<y<<" "<<x<<endl;
        }

        else{
            while(2*a + 1 + y + x != n)
            {
                while(x < a-2){
                    if(3*a + x+1 == n){
                            break;
                    }
                    else{x++;}
                }
                if(3*a + x +1== n){
                            break;
                    }
                y++;
                x++;
            }
            cout<<a<<" "<<"0"<<endl;
            cout<<a<<" "<<"1"<<endl;
            cout<<y<<" "<<x<<endl;
        }
    }

    else{
        cout<<"-1"<<endl;
    }
}