#include <iostream>

using namespace std;

int main()
{
    int n,a;

    cin>>n>>a;
    if(a*4+(a-2)*4+2*a==n)
    {
    cout<<a<<" "<<a-2<<endl;
    cout<<a-2<<" "<<a<<endl;
    cout<<a<<" "<<a-2<<endl;
    cout<<a-2<<" "<<a<<endl;
    cout<<a-1<<" "<<a+1;
    }
    else
        cout<<-1;
}