    #include<bits/stdc++.h>
    const int N=200010;
    int n,m;
    int main(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(nullptr);
        std::cin>>n>>m;
        if(m>0){
            if(m+2>n){
                std::cout<<"-1\n";
                return 0;
            }
            for(int i=1;i<=m+1;++i){
                std::cout<<i*2<<' '<<i*2+1<<'\n';
            }
            std::cout<<1<<' '<<(m+2)*2<<'\n';
            for(int i=1+(m+2)*2;i<=(m+2)*2+2*(n-(m+2));i+=2){
               std::cout<<i<<' '<<i+1<<'\n';
            }
        }else{   
            if(m==0){
                for(int i=1;i<=n;++i){
                    std::cout<<i*2<<' '<<i*2+1<<'\n';
                }
            }else{
                std::cout<<"-1\n";
            }
        }
        
        return 0;
    }
#include <cstdio>
#include <cctype>
using namespace std;

#define gc getchar
inline int read()
{
	int c = gc(), t = 1, n = 0;
	while (isspace(c)) { c = gc(); }
	if (c == '-') { t = -1, c = gc(); }
	while (isdigit(c)) { n = n * 10 + c - '0', c = gc(); }
	return n * t;
}
#undef gc

int main()
{
	int n = read(), m = read();

	if (m < 0)
	{
		puts("-1");
		return 0;
	}

	if (n == 1)
	{
		if (m != 0)
		{
			puts("-1");
			return 0;
		}

		puts("1 2");
		return 0;
	}

	if (m >= n - 1)
	{
		puts("-1");
		return 0;
	}

	for (int i = 1; i < n; i++)
		printf("%d %d\n", i * 4 - 2, i * 4);
	printf("1 %d\n", (m + 1) * 4 + 1);
	
	return 0;
}