#include<bits/stdc++.h>
using namespace std;
template<typename T>inline T read(){
	T f=0,x=0;char c=getchar();
	while(!isdigit(c)) f=c=='-',c=getchar();
	while(isdigit(c)) x=x*10+c-48,c=getchar();
	return f?-x:x;
}
namespace run{
	int n,m;
	int main(){
		n=read<int>(),m=read<int>();
		if(n==1){
			if(m!=0) puts("-1"),exit(0);
			puts("1 2"),exit(0);
		}
		if(m<0 || m>=n-1) puts("-1"),exit(0);

		int lim=1e6;
		printf("%d %d\n",1,lim);
		for(int i=1,k=2;i<=m+1;i++)
			printf("%d %d\n",k,k+1),k+=2;
		lim++;
		for(int i=m+2;i<n;i++) printf("%d %d\n",lim,lim+1),lim+=2;
		return 0;
	}
}
int main(){
#ifdef my
	freopen(".in","r",stdin);
	freopen(".out","w",stdout);
#endif
	return run::main();
}
/*
 * Author       : YangDavid
 * Created Time : 2020.10.24 20:11:31
 */
 
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 1; i <= n; ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int B = 10000000;
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	if(n == 1) {
		if(m == 0) {
			printf("1 2\n");
			return 0;
		} else {
			puts("-1");
			return 0;
		}
	}
	if(abs(m) >= n-1) { puts("-1"); return 0; }
	if(m >= 0) {
		printf("%d %d\n", 1, 2*m+3);
		rep(i, m+1)
			printf("%d %d\n", 2*i, 2*i+1+(i==m+1));
	} else {
        puts("-1");
        return 0;
		/*m = -m;
		printf("%d %d\n",2,2*m+4);
		rep(i, m+1)
			printf("%d %d\n", 2*i-(i==1), 2*i+1);
	*/}
	rep(i, n-m-2)
		printf("%d %d\n", B+4*i, B+4*i+1);
 
    return 0;
}
 