#include <bits/stdc++.h>

using namespace std;

int Ostatak(int a, int b, int c)
{
    return (a-b*c)%b;
}

int main()
{
    int N, A, ostatak;
    cin >> N >> A;
    int setovi[6];
    setovi[3]=3;
    setovi[4]=4;
    setovi[5]=5;

    if(N<3*A)
    {
        cout << "-1";
        return 0;
    }
    for(int l=3; l<=5; l++)
    {
        loop:
        ostatak=Ostatak(N, setovi[l], A);
        if(N<setovi[l]*A*2-ostatak)
        {
            for(int i=0; i<l; i++)
            {
                if(i==0) cout << A << " " << (N-setovi[l]*A)/setovi[l]+(N-setovi[l]*A)%setovi[l] << endl;
                else cout << A << " " << (N-setovi[l]*A)/setovi[l] << endl;
            }
            break;
        }
        else if(N>setovi[l]*A*2-2-ostatak && ostatak%2!=0)
        {
            if(l!=5)l++;
            goto loop;
        }
        if((2*A*setovi[l])<N && ostatak%2==0)
        {
            for(int i=0; i<l; i++)
            {
                if(i==0) cout << N/setovi[l]/2+ostatak/2+1 << " " << N/setovi[l]/2+ostatak/2-1 << endl;
                else cout << N/setovi[l]/2+1 << " " << N/setovi[l]/2-1 << endl;
            }
            break;
        }
        else if(((A*setovi[l])==N))
        {
            for(int i=0; i<l; i++)
                cout << A << " 0" << endl;
            break;
        }
        
    }
    return 0;
}