#include <iostream>

using namespace std;

int main ()
{
    int min, a, n, izlaz;

    cout << "ulaz (ukupan broj poena, min broj poena po setu)" << endl;
    cin >> n;
    cin >> a;

    min = 6*(a+1);

    if (min>n)
    cout << "-1"<< endl;
    else if (n>5*a-8)
                    {
                        cout << a << " " << a-4 << endl;
                        cout << a << " " << a-4 << endl;
                        cout << a << " " << n-(5*a-4) << endl;
                    }else if (n > 5*a+8)
                {
                    cout << a << " " << a+4 << endl;
                    cout << a+4 << " " << a << endl;
                    cout << a << " " << n-(5*a+8) << endl;
                }else if (n > 5*a+4)
            {
                cout << a+2 << " " << a << endl;
                cout << a+2 << " " << a << endl;
                cout << a << " " << n-(5*a + 4) << endl;
            }else if (n > 5*a-4)
    {
        cout << a << " " << a-2 << endl;
        cout << a << " " << a-2 << endl;
        cout << a << " " << n-(5*a-4) << endl;
    }else
        cout << "-1";



    return 0;
}