#include <iostream>

using namespace std;

int main()
{
    long long n, a, tmp;
    cin >> n >> a;
    long long r1 = 0, r2 = 0, r3 = 0, r4 = 0, r5 = 0, r6 = 0;

    if(3*a > n)
        cout << -1;
    else{
    r1 = a;
    r3 = a;


        r6 = (n - 2*a - 2)/2;
        r5 = r6 + 2;

     if(r5 < a){
        r6 -= a - r5;
        tmp = a - r5;
        r5 += tmp;
    }


    cout << r1 << " " << r2 << endl;
    cout << r3 << " " << r4 << endl;
    cout << r5 << " " << r6 << endl;
    }
    return 0;
}