#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    long long n,a,ds1,ds2,ts1,ts2;

    cin >> n;
    cin >> a;

    if(n<3*a)
    {
        cout << "-1" << endl;
        return 0;
    }

    cout << a << " " << "0" << endl;

    ds1=a;
    ds2=1;
    ts1=(n-2*a-1)/2+(n-2*a-1)%2;
    ts2=(n-2*a-1)-ts1;

    if(ts1-ts2==0)
    {
        ds2+=2;
        ts2-=2;
    }
    if(ts1-ts2==1)
    {
        ds2++;
        ts2--;
    }

    cout << ds1 << " " << ds2 << endl;
    cout << ts1 << " " << ts2 << endl;

    return 0;
}