#include <bits/stdc++.h>

#define xx first
#define yy second

using namespace std;

long long n, a;
pair<long long, long long> r[6];

int main()
{
    cin>>n>>a;

    if (n<3*a) cout<<-1;
    else
    {
        r[1].xx=a; r[2].xx=a; r[1].yy=0; r[2].yy=0;
        if (n%2==1) r[1].yy=1;
        int ost=n-r[1].xx-r[1].yy-r[2].xx-r[2].yy;
        r[3].xx=ost/2+1; r[3].yy=ost/2-1;
        cout<<r[1].xx<<" "<<r[1].yy<<endl<<r[2].xx<<" "<<r[2].yy<<endl<<r[3].xx<<" "<<r[3].yy;
    }
}