#include <iostream>
#include <vector>

using namespace std;

struct poeni {
    int pavle;
    int zivko;
};

void stampaj(vector <poeni> &v, int &korisceno)
{
    for(int i = 0; i < korisceno; i++)
    {
        cout << v[i].pavle << " " << v[i].zivko << endl;
    }

}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int N, A;

    cin >> N >> A;

    vector <poeni> v(5);

    //int pavleBrojac = 0;
    //int zivkoBrojac = 0;

    int korisceno = 0;

    if(A * 3 > N)
    {
        cout << -1 << endl;
        return 0;
    }

    else if(A * 4 > N)
    {
        v[0].pavle = A;
        v[0].zivko = 0;
        korisceno++;

        N -= A;

        v[1].pavle = A;
        v[1].zivko = 0;
        korisceno++;

        N -= A;

        v[2].pavle = A;
        v[2].zivko = N - A;
        korisceno++;

        if(v[2].pavle - v[2].zivko < 2)
        {
            v[0].zivko += 2;
            v[2].zivko -= 2;
        }

        stampaj(v, korisceno);
        return 0;
    }

    v[0].pavle = A;
    v[0].zivko = 0;
    korisceno++;

    v[1].pavle = A;
    v[1].zivko = 0;
    korisceno++;

    N -= 2 * A;

    v[2].pavle = (N + 2) / 2;
    v[2].zivko = v[2].pavle - 2;
    korisceno++;

    N -= (v[2].pavle + v[2].zivko);

    if(N == 1)
    {
        v[0].zivko = 1;
    }

    stampaj(v, korisceno);

    return 0;
}