#include <iostream>

using namespace std;

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

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

    if(n>=2*a)
    {
        int l = n/2;
        cout << l+1 << " " << l-1;
    }
    else
    {
        cout << a << " " << n-a;
    }
}