#include <iostream>
using namespace std;

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

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

    }
    else {
        cout << -1 << endl;
        return 0;
    }

    cout << bx1 << " " << bp1 << endl;
    cout << bx2 << " " << bp2 << endl;
    cout << bx3 << " " << bp3 << endl;
    //cout << " = " << zbir << endl;

    return 0;
}