#include <iostream>

using namespace std;
int N, A;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>N>>A;
    if(N<3*A)
    {
        cout<<-1<<endl;
    }
    /*
    else if(N<=6*A-6)
    {
        //3*A<=N<=6*A-6
        int odnos=N/A;
        int ostatak=(odnos)*A-N;
        static int setovi[3][3];
        int brojac=0;
        for(int i=0;i<2 && brojac<=odnos;i++)
        {
            brojac+=1;
            for(int j=0;j<3 && brojac<=odnos;j++)
            {
                setovi[i][j]=1;
                brojac+=1;
            }
        }
        
        cout<<setovi[0][0]*A<<" "<<setovi[1][0]*(A-2)+ostatak<<endl;
        cout<<setovi[0][1]*A<<" "<<setovi[1][1]*(A-2)<<endl;
        cout<<setovi[0][2]*A<<" "<<setovi[1][2]*(A-2)<<endl;
    }
    
    else if(N%2==0)
    {
        cout<<A<<" "<<A-2<<endl;
        cout<<A<<" "<<A-2<<endl;
        int x=(N+6-6*A)/2;
        cout<<A+x<<" "<<A+x-2<<endl;
    }
    else if(N%2==1)
    {
        cout<<A<<" "<<A-3<<endl;
        cout<<A<<" "<<A-2<<endl;
        int x=(N+7-6*A)/2;
        cout<<A+x<<" "<<A+x-2<<endl;
    }*/
    else
    {
        int p=(N+2)%(2*A);
        int x=p/2,y=p/2+p%2;
        int z=(N+2-x-y)/(2*A)-1;
        cout<<A<<" "<<x<<endl;
        cout<<A<<" "<<y<<endl;
        cout<<z*A<<" "<<z*A-2<<endl;
        
    }
    return 0;
}