#include <iostream>

using namespace std;



int main()
{
    long long int a,n,temp = 0,setovi[3][2],begN;
    cin >> n >> a;

    begN = n;

    if(n < 3*a) {
        cout << -1;
        return 0;
    }

    setovi[0][0] = a;
    setovi[1][0] = a;
    setovi[2][0] = a;

    setovi[0][1] = 0;
    setovi[1][1] = 0;
    setovi[2][1] = 0;

    n -= 3*a;

    if(n <= a) {
        setovi[0][1] = n;
        n = 0;
    }
    else {
        setovi[0][1] = a-2;
        n -= (a-2);
        if(n % 2 == 1) {
            temp = 1;
            n--;
        }
        setovi[0][0] += n/2;
        setovi[0][1] += n/2;
        setovi[1][1] += temp;
    }

    cout << setovi[0][0] << " " << setovi[0][1] << endl;
    cout << setovi[1][0] << " " << setovi[1][1] << endl;
    cout << setovi[2][0] << " " << setovi[2][1] << endl;

    return 0;
}