#include <bits/stdc++.h>

#define ll long long

using namespace std;

int main() {

    ll n, a;
    cin >> n >> a;

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

    if(n <= 6 * a - 6) {
        n -= 3 * a;
        if(n <= a - 2) {
            cout << a << " " << n << endl;
            cout << a << " 0" << endl;
            cout << a << " 0" << endl;
            return 0;
        }

        n -= a - 2;
        if(n <= a - 2) {
            cout << a << " " << a - 2 << endl;
            cout << a << " " << n << endl;
            cout << a << " 0" << endl;
            return 0;
        }

        n -= a - 2;
        if(n <= a - 2) {
            cout << a << " " << a - 2 << endl;
            cout << a << " " << a - 2 << endl;
            cout << a << " " << n << endl;
            return 0;
        }
    }

    if(n & 1)
        cout << a << " 1" << endl, n--;
    else
        cout << a << " 0" << endl;
    cout << a << " 0" << endl;

    ll x = (n - 2 * a + 2) / 2;
    cout << x << " " << x - 2 << endl;
    return 0;
}