#include<bits/stdc++.h>
using namespace std;
void ispis(int pBroj,int gBroj,int brSetova,int Ostatak)
{
    if(brSetova==4)
    {
        cout<<gBroj<<" "<<pBroj<<endl;
        for(int i=0;i<2;i++)
            cout<<pBroj<<" "<<gBroj<<endl;
    }
        if(brSetova==5)
    {
        cout<<gBroj<<" "<<pBroj<<endl;
        cout<<gBroj<<" "<<pBroj<<endl;
        for(int i=0;i<2;i++)
            cout<<pBroj<<" "<<gBroj<<endl;
    }
    if(brSetova==3)
    {
        for(int i=0;i<2;i++)
            cout<<pBroj<<" "<<gBroj<<endl;
    }
    cout<<pBroj<<" "<<gBroj+Ostatak;
}
int main()
{
    int a,n,ostatak,ostatak2,brPoSetu,prelivanje;
    cin>>n>>a;
    if(n<3*a)
    {
        cout<<-1;
        return 0;
    }
    for(int i=3;i<5;i++)
    {
        if((a*i+(a-2)*i)>=n)
        {
            ostatak=n-i*a;
            brPoSetu=ostatak/i;
            ostatak2=ostatak%i;
            ispis(a,brPoSetu,i,ostatak2);
            return 0;
        }
    }
    if((a*5+(a-2)*5)>=n)
        {
            ostatak=n-5*a;
            brPoSetu=ostatak/5;
            ostatak2=ostatak%5;
            ispis(a,brPoSetu,5,ostatak2);
            return 0;
        }
        else
        {
            prelivanje=n-(a*5+(a-2)*5);
            if(prelivanje%2==0)
            {
                cout<<a-2<<" "<<a<<endl;
                cout<<a-2<<" "<<a<<endl;
                cout<<a<<" "<<a-2<<endl;
                cout<<a<<" "<<a-2<<endl;
                cout<<a+prelivanje/2<<" "<<a-2+prelivanje/2;
                return 0;
            }
            else cout<<-1<<endl;
        }
}