#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<V>;
using VVV = vector<VV>;
using VL = vector<ll>;
using VVL = vector<VL>;
using VVVL = vector<VVL>;
template<class T> using VE = vector<T>;
template<class T> using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
ll upper = MOD + MOD;
ll under = -upper;
ll UPPER = MOD * MOD;
ll UNDER = -UPPER;
const long double pi = 3.141592653589793;
int main() {
	int n, m;
	cin >> n >> m;
	if (n == m || n == m + 1 && m != 0 || m < 0) {
		cout << -1 << endl;
		return 0;
	}
	V a, b;
	m++;
	int pos = 2;
	while (m) {
		m--;
		a.push_back(pos), b.push_back(pos + 1);
		pos += 2;
	}
	a.push_back(1), b.push_back(pos);
	int N = n - a.size();
	int over = 100000000;
	while (N > 0) {
		N--;
		a.push_back(over), b.push_back(over + 1);
		over += 2;
	}
	rep(i, n) {
		cout << a[i] << " " << b[i] << endl;
	}
	return 0;
}
#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';
	}
} 