#include <bits//stdc++.h>

using namespace std;

bool promena=false;

int mecevi(int i, int a, int sred, int sred1)
{
    int d=0, mec1, mec2, j=0;
    int i1=i;
    int b[20];
    while(i!=1)
    {
        mec1=a+d;
        mec2=sred-mec1;
        if(abs(mec1-mec2)>=2)
        {
            b[j]=mec1;
            b[j+1]=mec2;
            j=j+2;
            i--;
            d=0;
        }
        else
        {
            d++;
        }
    }
    d=0;
    while(i==1)
    {
        mec1=a+d;
        mec2=sred1-mec1;
        if(abs(mec1-mec2)>=2)
        {
            b[j]=mec1;
            b[j+1]=mec2;
            j=j+2;
            i--;
            d=0;
        }
        else
            d++;
    }
    bool br=true;
    if(i1==3)
    {
        promena=true;
        for(int k=0; k<6; k++)
        {
            if(b[k]>=b[k+1])
                cout<<b[k]<<" "<<b[k+1]<<endl;
            else
                cout<<b[k+1]<<" "<<b[k]<<endl;
            k++;
        }
    }
    else if(i1==4)
    {
        promena=true;
        for(int k=0; k<8; k++)
        {
            if(br==true)
            {
                if(b[k]>=b[k+1])
                    cout<<b[k]<<" "<<b[k+1]<<endl;
                else
                    cout<<b[k+1]<<" "<<b[k]<<endl;
                k++;
                if(br==2)
                    br=false;
            }
            else
            {
                if(b[k]<=b[k+1])
                    cout<<b[k]<<" "<<b[k+1]<<endl;
                else
                    cout<<b[k+1]<<" "<<b[k]<<endl;
                br=true;
            }
            k++;
        }
    }
    else
    {
        promena=true;
        for(int k=0; k<10; k++)
        {
            if(br==true)
            {
                if(b[k]>=b[k+1])
                    cout<<b[k]<<" "<<b[k+1]<<endl;
                else
                    cout<<b[k+1]<<" "<<b[k]<<endl;
                br=false;
            }
            else
            {
                if(b[k]<=b[k+1])
                    cout<<b[k]<<" "<<b[k+1]<<endl;
                else
                    cout<<b[k+1]<<" "<<b[k]<<endl;
                br=true;
            }
            k++;
        }
    }
}

int main()
{
    int sum, a;
    cin>>sum>>a;
    bool promena=false;
    for(int i=3; i<6; i++){
    if(sum>=a*3)
    {
        int sred=sum/i;
        int sred1=sum-(sred*i)+sred;
        if(sred%2==0)
        {
            sred1=sred1+i-1;
            sred--;
        }
        if(sred1%2==0)
        {
            sred=sred+i-1;
            sred1--;
        }
        if(sred%2!=0 && sred1%2!=0)
        {
            mecevi(i,a,sred,sred1);
        }
        if(promena=true)
            i=6;
    }
    }
    if(promena==false)
    {
    cout<<"-1"<<endl;
    }


}