#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;
}
#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;
}
