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

int main()
{
    int ukupno, sett;
    cin >> ukupno >> sett;

    if (ukupno < sett*3)
    {
        cout << "-1" << endl;
        return 0;
    }

    if (ukupno%2 == 0)
    {
        if (sett%2 == 0 && ukupno >= 4*sett+1)
        {
            cout << sett << " " << "0" << endl;
            cout << sett << " " << "0" << endl;
            cout << (ukupno-2*sett)/2 + 1 << " " << (ukupno-2*sett)/2 - 1 << endl;
        }
        if (sett%2 == 0 && ukupno < 4*sett+1)
        {
            cout << sett << " " << "0" << endl;
            cout << sett << " " << "0" << endl;
            cout << sett << " " << ukupno-3*sett << endl;
        }
        if (sett%2 == 1 && ukupno >= 4*sett+1)
        {
            cout << sett << " " << "0" << endl;
            cout << sett << " " << "0" << endl;
            cout << (ukupno-2*sett-1)/2 + 1 << " " << (ukupno-2*sett-1)/2 - 1 << endl;
        }
        if (sett%2 == 1 && ukupno < 4*sett+1)
        {
            cout << sett << " " << "0" << endl;
            cout << sett << " " << "0" << endl;
            cout << sett << " " << ukupno-3*sett-1 << endl;
        }
    }

    if (ukupno%2 == 1)
    {
        if (sett%2 == 0 && ukupno >= 4*sett+1)
        {
            cout << sett << " " << "1" << endl;
            cout << sett << " " << "0" << endl;
            cout << (ukupno-2*sett-1)/2 + 1 << " " << (ukupno-2*sett-1)/2 - 1 << endl;
        }
        if (sett%2 == 0 && ukupno < 4*sett+1)
        {
            cout << sett << " " << "1" << endl;
            cout << sett << " " << "0" << endl;
            cout << sett << " " << ukupno-3*sett-1 << endl;
        }
        if (sett%2 == 1 && ukupno >= 4*sett+1)
        {
            cout << sett << " " << "1" << endl;
            cout << sett << " " << "0" << endl;
            cout << (ukupno-2*sett-1)/2 + 1 << " " << (ukupno-2*sett-1)/2 - 1 << endl;
        }
        if (sett%2 == 1 && ukupno < 4*sett+1)
        {
            cout << sett << " " << "0" << endl;
            cout << sett << " " << "0" << endl;
            cout << sett << " " << ukupno-3*sett << endl;
        }
    }

    return 0;
}