#include <bits/stdc++.h>

using namespace std;

void resi(int n, int a){
    int x, y;
    n -= a*5;
    int kolicnik = n/5, ostatak = n%5;
    x = a;
    y = kolicnik + ostatak;
    if(abs(x - y) < 2){
        x += 2;
        y -= 2;
    }
    cout << x << " " << y << '\n';
    for(int i = 1;i < 5;i++){
        x = a;
        y = kolicnik;
        if(abs(x - y) < 2){
            x += 2;
            y -= 2;
        }
        cout << x << " " << y << '\n';
    }
}

int main(){
    ios::sync_with_stdio(false);
    int n, a;
    cin >> n >> a;
    if(n <= a)
        cout << "-1";
    else
        resi(n, a);
    return 0;
}