#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
//#define int long long
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PI = pair<pair<int,int>,int>;
using PL = pair<long long, long long>;
using PLL = pair<pair<long long, long long>, long long>;
using Pxy = pair<double, double>;
using Tiib = tuple<int, int, bool>;
const int INF = 1001001007;
const long long mod = 1000000007LL;
const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

void yes(){
    cout << "Yes" << endl;
}

void no (){
    cout << "No" << endl;
}

ll cel (ll a, ll b){
    if (a % b == 0) return a / b;
    else return a / b + 1;
}

ll gcds(ll a, ll b){
    ll c = a % b;
    while (c != 0){
        a = b;
        b = c;
        c = a % b;
    }
    return b;
}

int main(){
    int n, mm; cin >> n >> mm;
    int m = abs(mm);
    if (n == 1) {cout << 1 << " " << 2 << endl; return 0;}
    if (n - m <= 1 || mm < 0) {cout << -1 << endl; return 0;}
    vector<P> ans;
    if (mm > 0){
        ans.emplace_back(P(1,1 + 2 * (m+1)));
        rep(i,m){
            ans.emplace_back(P(2+i*2,3+i*2));
        }
        ans.emplace_back(P(2+m*2,4+m*2));
        rep(i,n-m-2){
            ans.emplace_back(P(3 + 2*(m+1) + i*2, 4 + 2*(m+1) + i*2));
        }
        rep(i,n) cout << ans[i].first << " " << ans[i].second << endl;
    }
    else {
        rep(i,n){
            cout << 1 + 2 * i << " " << 2 + 2 * i << endl;
        }
    }
}
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
#define ch() getchar()
#define pc(x) putchar(x)
template<typename T>inline void read(T&x){
	int f;char c;
	for(f=1,c=ch();c<'0'||c>'9';c=ch())if(c=='-')f=-f;
	for(x=0;c<='9'&&c>='0';c=ch())x=x*10+(c&15);x*=f;
}
template<typename T>inline void write(T x){
	static char q[64];int cnt=0;
	if(!x)pc('0');if(x<0)pc('-'),x=-x;
	while(x)q[cnt++]=x%10+'0',x/=10;
	while(cnt--)pc(q[cnt]);
}
int main(){
	int n,m;read(n),read(m);
	if(n==1&&m==0)puts("1 2");
	else if(m>n-2||m<0)puts("-1");
	else if(m==0){
		for(int i=1;i<=n;++i)
			write(i),pc(' '),write(i+n),pc('\n');
	}
	else{
		const int Base=300000;
		for(int i=1;i<=m+1;++i)
			write(i*2-1+Base),pc(' '),write(i*2+Base),pc('\n');
		int l=0,r=(m+1)*2+1;
		for(int i=m+2;i<=n;++i)
			write((l--)+Base),pc(' '),write((r++)+Base),pc('\n');
	}
	return 0;
}
