#include <iostream>

using namespace std;

int main()
{
    long long int n, a;
    cin >> n >> a;
    if(n<3*a)
    {
        cout << -1;
        return 0;
    }
    long long int a1=a, a2=a, a3=a, b1=0, b2=0, b3=0;
    n-=3*a;
    if(n<=a-2)
        b3+=n;
    else
    {
        b3+=a-2;
        n-=a-2;
        if(n%2==1)
        {
            n--;
            b2++;
        }
        a3+=n/2;
        b3+=n/2;
    }
    cout << a1 << " " << b1 << endl;
    cout << a2 << " " << b2 << endl;
    cout << a3 << " " << b3;
    return 0;
}