#include<bits/stdc++.h>
using namespace std;
int n,m;
int main(){
	cin>>n>>m;
	if(n==1&&m==0)cout<<"1 2"<<endl,exit(0);
	if(m<0||m>=n-1)cout<<-1,exit(0);
	n--;
	cout<<"1 1000001"<<endl;
	for(int i=1;i<=m+1;i++)cout<<i*2<<" "<<i*2+1<<endl;
	n-=m+1;
	for(int i=1;i<=n;i++)cout<<1000000+i*2<<" "<<1000000+i*2+1<<endl; 
	return 0;
}
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#include <list>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template<typename T = int> using V = vector<T>;
template<typename T = int> using VV = vector<vector<T>>;
template <typename T, typename S>
ostream& operator<<(ostream& os, pair<T, S> a) {
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for (auto x : v) os << x << ' ';
    return os;
}
void debug() {
    cerr << '\n';
}
template <typename H, typename... T>
void debug(H a, T... b) {
    cerr << a;
    if (sizeof...(b)) cerr << ", ";
    debug(b...);
}

int solve(int n,vector<int>L, vector<int>R){
    vector<pii>a(n);
    rep(i,n){
        a[i] = pii(L[i], R[i]);
    }
    sort(a.begin(), a.end(), [](pii x, pii y){
        return x.second < y.second;
    });
    int pre = -1;
    int ans = 0;
    for(auto x: a){
        if(pre < x.first){
            ans++;
            pre = x.second;
        }
    }
    return ans;
}
int solve2(int n, vector<int>L, vector<int>R){
    vector<pii>a(n);
    rep(i,n){
        a[i] = pii(L[i], R[i]);
    }
    sort(a.begin(), a.end(), [](pii x, pii y){
        return x.first < y.first;
    });
    int pre = -1;
    int ans = 0;
    for(auto x: a){
        if(pre < x.first){
            ans++;
            pre = x.second;
        }
    }
    return ans;
}
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    if(m < 0){
        cout << -1 << endl;
        return 0;
    }
    vector<int>a(n), b(n);
    int t = 4;
    //[0,1], 2[3,4], 5[
    //[1,2] 3 [4,5]
    rep(i,n-1){
        a[i+1] = t++;
        b[i+1] = t++;
        t++;
    }
    a[0] = 1;
    b[0] = 3;
    rep(i,m+1)b[0] += 3;
    if(solve(n,a,b)-solve2(n,a,b)!=m){
        cout << -1 << endl;
        return 0;
    }
    rep(i,n){
        cout << a[i] << " " << b[i] << "\n";
    }
}


