#include <iostream>

using namespace std;

bool imaResenje(int a, int b)
{
    if(a<3*b) return false;
    else return true;
}

int brojSetova(int a, int b)
{
    if((a/3 > b) && (a/4<b)) return 3;
    if((a/4 > b) && (a/5<b)) return 4;
    if(a/5 > b) return 5;
    return 0;
}

bool ukupanBrojNeparan(int n)
{
    return n%2==1;
}

int main()
{
    int n,a;
    cin >> n >> a;

    int br = brojSetova(n,a);
    if(imaResenje(n,a) && br) {
        int ostatak = n;
        if(ukupanBrojNeparan(n)) {
            cout << a << " " <<1 << endl;
            ostatak = ostatak - a - 1;
            for(int i=0; i<br-2;i++) {
                if(i%2==0) { cout << "0 " << a << endl; ostatak -= a;}
                if(i%2==1) { cout << a << " 0" << endl; ostatak -= a; }
            }
            ostatak /= 2;
            cout << ostatak - 1 << " " << ostatak + 1 << endl;
        } else {
            for(int i=0; i<br-1;i++) {
                if(i%2==0) { cout << "0 " << a << endl; ostatak -= a;}
                if(i%2==1) { cout << a << " 0" << endl; ostatak -= a; }
            }
            ostatak /= 2;
            cout << ostatak - 1 << " " << ostatak + 1 << endl;
        }
    } else cout << "-1" << endl;

    return 0;
}