#include <iostream>

using namespace std;

int main()
{
    long long int a,n;
    cin >> n >> a;
    long long int ost = n- 2*a;
    bool paran = true;
    long long int p1,p2;
    if (ost%2 == 1) {
        paran = false;
    }
    p1 = ost/2 +1;
    p2 = ost/2 -1;
    if (ost <=0) {
        cout << "-1" <<endl;
    } else {
    cout << p1 << " " << p2 << endl;
    if (paran) {
        cout << a << " " << 0 << endl;
    } else {
        cout << a << " " << 1 << endl;
    }
    cout << a << " " <<0 << endl;
    }
    return 0;
}