#include <iostream>
using namespace std;

int a,n,bx1,bx2,bx3 , bp1 , bp2 , bp3 ,zbir , zx , pn;

int main() {
    cin >> n >> a;
    pn = n;
    if (3*a <= n){
        bx1 = a;
        bx2 = a;
        bx3 = a;
        n -= 3*a;
        bp1 = a-2;
        bp2 = bp1;
        bp3 = bp2;
        zbir = bp1 + bp2 + bp3 + bx1 + bx2 + bx3;
        while (zbir > pn and bp1 > 0){
            zbir -=bp1/2;
            bp1 /= 2;
        }
        while (zbir > pn and bp3 > 0){
            zbir -=bp3/2;
            bp3 /=2;
        }
        while (zbir > pn and bp2 > 0){
            zbir -= bp2/2;
            bp2 /= 2;
        }
        while (zbir < pn){
            bp1 +=2;
            bx1 +=2;
            zbir +=4;
        }
        //cout << " = "<< zbir << endl;
        zbir = bp1 + bp2 + bp3 + bx1 + bx2 + bx3;
        //cout << " zbir = " << zbir << endl;
        //cout << " pn = " << pn << endl;
        if (zbir - 1 == pn) {
            bp2 --;
        }
        if (zbir + 1== pn){
            bp1 ++;
            bx1 ++;
            bp2 --;
        }
    }
    else {
        cout << -1 << endl;
        return 0;
    }
    zbir = bp1 + bp2 + bp3 + bx1 + bx2 + bx3;
    /*cout << "____________________" << endl;*/
    cout << bx1 << " " << bp1 << endl;
    cout << bx2 << " " << bp2 << endl;
    cout << bx3 << " " << bp3 << endl;
    //cout << " zbir = " << zbir << endl;

    return 0;
}