#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ll n, a; cin >> n >> a;

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

    ll first, second;
    if ( (n - (2*a)) < (2*a) ) {
        second = n - 3*a;
        if (a - second < 2) {
            cout << a << " 1" << endl;
            cout << a << " 0" << endl;
            cout << a << " " << second-1 << endl;
        }
        else {
            cout << a << " 0" << endl;
            cout << a << " 0" << endl;
            cout << a << " " << second << endl;
        }
    }
    else {

        ll tmp = n-(2*a);
        if (tmp % 2 == 0) {
            cout << a << " 0" << endl;
            cout << a << " 0" << endl;
            first = tmp/2+1;
            second = tmp/2-1;
        }
        else {
            cout << a << " 0" << endl;
            cout << a << " 1" << endl;
            tmp--;
            first = tmp/2+1;
            second = tmp/2-1;
        }

        cout << first << " " << second << endl;

    }

    return 0;
}