#include <iostream>

using namespace std;

int main()
{
    int x,y,z,a,b;
    cin >> x >> y;
    z = x-(2*y);
    a = z/2;

    if (x == y)
        cout << "-1";
    else if (x%2 == 1)
        cout << y << " 1" << endl << y << " 0" << endl << a+1 << " " <<  a-1 << endl;
    else cout << y << " 0" << endl << y << " 0" << endl << a+1 << " " <<  a-1 << endl;


    return 0;
}