#include <iostream>

using namespace std;

int main()
{
int N, A;
cin >> N >> A;
if (3*A>N) {
    cout << -1 << endl;
}
else {
    cout << A << " " << 0 << endl;
    cout << A << " " << 0 << endl;
    cout << (N-2*A)/2 + 1 << " " << (N-2*A)/2 -1 << endl;
}
return 0;
}