#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5;
int main(){
	vector<pair<int,int>>ans;
	int n,m;cin>>n>>m;	
	int x=m;
	if((m>0&&x+2>n)||m<0){
		cout<<"-1\n";
		return 0;
	} 
	ans.emplace_back(1,4*x+3);
	for(int i=0;i<n-1;i++){
		ans.emplace_back(4*i+2,4*i+4);
	}	
	for(auto& i:ans){
		cout<<i.first<<' '<<i.second<<'\n';
	}
} 
#include <bits/stdc++.h>

using namespace std;

int main() {

	ios::sync_with_stdio(false);
	cin.tie(0);

	int n, m;
	cin >> n >> m;

	if(n == 1) {
		if(m != 0)
			cout << -1 << endl;
		else
			cout << "1 2" << endl;
		return 0;
	}

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

	if(m == 0) {
		for(int i=0, s = 5; i<n; ++i, s+= 2) {
			cout << s << " " << s + 1 << endl;
		}
		return 0;
	}

	assert(m <= n - 2);
	
	cout << 1 << " " << 2*(m + 1) + 5 << endl; 

	for(int s=2, cnt=0; cnt<m+1; s+=2, ++cnt) {
		cout << s << " " << s + 1 << endl;
	}

	int start = 2*(m + 1) + 10;
	for(int k=0; k < n-m-2; ++k) {
		cout << start << " " << start + 1 << endl;
		start += 2;
	}


	return 0;
}












