#include <bits/stdc++.h>

using namespace std;

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

int main()
{
    int N, A;
    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++)
    {
        if((A*setovi[l])<N)
        {
            if(ostatak(N, setovi[l], A)%2==0)
            {
                for(int i=0; i<l; i++)
                    {
                        if(i==0) cout << N/setovi[l]/2+ostatak(N, setovi[l], A)/2+1 << " " << N/setovi[l]/2+ostatak(N, setovi[l], A)/2-1 << endl;
                        else cout << N/setovi[l]/2+1 << " " << N/setovi[l]/2-1 << endl;
                    }
                break;
            }
            else cout << "-1";
        }
        else if(((A*setovi[l])==N))
        {
            for(int i=0; i<l; i++)
                cout << A << " 0" << endl;
            break;
        }
    }
}