#include <iostream>

using namespace std;

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