#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"

ll n, m;

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    cin >> n >> m;

    if(m < 0) {
        cout << -1 << endl;
        return 0;
    }

    if(m == 0) {
        ll rr = 0;

        for(int i = 1; i <= n; i++) {
            cout << rr + (2*i - 1) << " " << rr + (2*i) << endl;
        }

        return 0;
    }

    if((m > 0) and (n < (m+2))) {
        cout << -1 << endl;
        return 0;
    }

    ll r = n - (m+2);
    ll rr = (m+1) * 2 + 2;

    cout << 1 << " " << rr << endl;

    for(int i = 1; i <= m+1; i++) {
        cout << 2*i << " " << 2*i+1 << endl;
    }

    for(int i = 1; i <= r; i++) {
        cout << rr + (2*i - 1) << " " << rr + (2*i) << endl;
    }
    
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cctype>
#include <cmath>
#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <stack>
#include <queue>
#include <ctime>
#define _for(i,a,b) for(int i=(a);i<(b);++i)
#define _rep(i,a,b) for(int i=(a);i<=(b);++i)
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long LL;
inline int read_int(){
	int t=0;bool sign=false;char c=getchar();
	while(!isdigit(c)){sign|=c=='-';c=getchar();}
	while(isdigit(c)){t=(t<<1)+(t<<3)+(c&15);c=getchar();}
	return sign?-t:t;
}
inline LL read_LL(){
	LL t=0;bool sign=false;char c=getchar();
	while(!isdigit(c)){sign|=c=='-';c=getchar();}
	while(isdigit(c)){t=(t<<1)+(t<<3)+(c&15);c=getchar();}
	return sign?-t:t;
}
inline char get_char(){
	char c=getchar();
	while(c==' '||c=='\n'||c=='\r')c=getchar();
	return c;
}
inline void write(LL x){
	char c[21],len=0;
	if(!x)return putchar('0'),void();
	if(x<0)x=-x,putchar('-');
	while(x)c[++len]=x%10,x/=10;
	while(len)putchar(c[len--]+48);
}
inline void space(LL x){write(x),putchar(' ');}
inline void enter(LL x){write(x),putchar('\n');}
const int MAXN=2e5+5;
int p[MAXN],a[MAXN],b[MAXN];
LL s[MAXN];
int Find(int x){
	return p[x]==x?x:p[x]=Find(p[x]);
}
int main()
{
//	freopen("test.in","r",stdin);
//	freopen("test.out","w",stdout);
	int n=read_int(),m=read_int();
	if(n==1&&m==0)
	printf("%d %d\n",1,2);
	else if(m<0||m>=n-1)puts("-1");
	else if((n-m)%2==1){
		m++;
		int pos=1,d=(n-m)/2;
		_for(i,1,d){
			printf("%d %d\n%d %d\n",pos,pos+3,pos+1,pos+2);
			pos+=4;
		}
		d=n-2*(d-1)-1;
		printf("%d %d\n",pos,pos+1+2*d);
		pos++;
		_rep(i,1,d-2)
		printf("%d %d\n",pos,pos+1),pos+=2;
		printf("%d %d\n%d %d\n",pos,pos+3,pos+1,pos+2);
	}
	else{
		int pos=1,d=(n-m)/2;
		_for(i,1,d){
			printf("%d %d\n%d %d\n",pos,pos+3,pos+1,pos+2);
			pos+=4;
		}
		d=n-2*(d-1)-1;
		printf("%d %d\n",pos,pos+1+2*d);
		pos++;
		_rep(i,1,d)
		printf("%d %d\n",pos,pos+1),pos+=2;
	}
	return 0;
}