#include <iostream>

using namespace std;

int main()
{
    int N,A;
    int prvi,drugi,k;
    cin >> N >> A;
    if (N < 6 || N < 3*A) {
        cout << -1;
        return 0;
    }

    if (N == 3 * A) {
        cout << A << " " << 0 << endl;
        cout << A << " " << 0 << endl;
        cout << A << " " << 0 << endl;
        return 0;
    }
    if (N == 4 * A) {
        cout << A << " " << 0 << endl;
        cout << A << " " << 0 << endl;
        cout << A << " " << 0 << endl;
        cout << A << " " << 0 << endl;
        return 0;
    }
    if (N == 5 * A) {
        cout << A << " " << 0 << endl;
        cout << A << " " << 0 << endl;
        cout << A << " " << 0 << endl;
        cout << A << " " << 0 << endl;
        cout << A << " " << 0 << endl;
        return 0;
    }
    if (N % 2 == 0) {
        prvi = (N / 2) - 3;
        drugi = (N / 2) + 3;
        if (prvi % 3 == 0 && drugi % 3 == 0) {
            cout << prvi / 3 << " " << drugi / 3 << endl;
            cout << prvi / 3 << " " << drugi / 3 << endl;
            cout << prvi / 3 << " " << drugi / 3 << endl;
            return 0;
        }
        prvi = (N / 2) - 4;
        drugi = (N / 2) + 4;
        if (prvi % 4 == 0 && drugi % 4 == 0) {
            cout << prvi / 4 << " " << drugi / 4 << endl;
            cout << prvi / 4 << " " << drugi / 4 << endl;
            cout << prvi / 4 << " " << drugi / 4 << endl;
            return 0;
        }
        prvi = (N / 2) - 5;
        drugi = (N / 2) + 5;
        if (prvi % 5 == 0 && drugi % 5 == 0) {
            cout << prvi / 5 << " " << drugi / 5 << endl;
            cout << prvi / 5 << " " << drugi / 5 << endl;
            cout << prvi / 5 << " " << drugi / 5 << endl;
            return 0;
        }

    }


    return 0;
}