#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main ()
{
    ios_base::sync_with_stdio(false);
    ll n, a; cin >> n >> a;
    if(n<3*a || ((n&1) && a==2)) return cout << -1 << endl, 0;
    n = n-3*a;
    if(n<=a-2) {
        cout << a << " " << n << endl;
        cout << a << " " << 0 << endl;
        cout << a << " " << 0 << endl;
    }
    else {
        cout << a << " " << (n-a+2)%2 << endl;
        cout << a << " " << 0 << endl;
        cout << a + (n-a+2)/2 << " " << a-2 + (n-a+2)/2 << endl;
    }
    return 0;
}