#include<iostream>
using namespace std;

main()
{
    int x,y;
    cin>>x>>y;
    if(x*4+(x-2)*4+2*a==y)
    {
        cout<<x<<" "<<x-2<<endl;
        cout<<x-2<<" "<<x<<endl;
        cout<<x<<" "<<x-2<<endl;
        cout<<x-2<<" "<<x<<endl;
        cout<<x-1<<" "<<x+1;
    }
    else
    cout<<-1;
}