#include<bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int maxn = 200000 + 1;
void no(){
    cout << -1;
    exit(0);
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int N, M;
    cin >> N >> M;
    if(M < 0) no();
    if(M == 0){
        for(int i = 1; i <= N; i += 1) cout << i * 10 << " " << i * 10 + 1 << "\n";
        return 0;
    }
    if(M > N - 2) no();
    for(int i = 1; i < N; i += 1) cout << i * 10 << " " << i * 10 + 1 << "\n";
    cout << "1 " << (M + 1) * 10 + 2 << "\n";
    return 0;
}
#include<bits/stdc++.h>
#define pb emplace_back
#define AI(i) begin(i), end(i)
using namespace std;
using ll = long long;
#ifdef KEV
#define DE(args...) kout("[ " + string(#args) + " ] = ", args)
void kout() {cerr << endl;}
template<class T1, class ...T2>
void kout (T1 v, T2 ...e) { cerr << v << ' ', kout(e...); }
template<class T>
void debug(T L, T R) { while (L != R) cerr << *L << " \n"[next(L)==R], ++L; }
#else
#define DE(...) 0
#define debug(...) 0
#endif
const int MAX_N = 300010;
int n, m;
int l[MAX_N], r[MAX_N];
int tak() {
	vector<pair<int,int>> a;
	for (int i = 1;i <= n;++i)
		a.pb(l[i], r[i]);
	sort(AI(a), [&](auto x, auto y) {
			return x.second < y.second;
			});
	int len = 0;
	int cur = -1;
	for (auto [l, r] : a) 
		if (l > cur) ++len, cur = r;
	return len;
}
int aok() {
	vector<pair<int,int>> a;
	for (int i = 1;i <= n;++i)
		a.pb(l[i], r[i]);
	sort(AI(a));
	int len = 0;
	int cur = -1;
	for (auto [l, r] : a) 
		if (l > cur) ++len, cur = r;
	return len;
}
void construct(int n, int m) {
	for (int i = 1;i <= n;++i)
		l[i] = 4 * i+1, r[i] = l[i] + 2;
	r[1] = r[m+2]+1;
	for (int i = 1;i <= n;++i) {
		cout << l[i] << ' ' << r[i] << '\n';
		assert(l[i] < r[i]);
		assert(l[i] >= 1 && r[i] <= 1000000000);
	}
	set<int> v;
	for (int i = 1;i <= n;++i)
		v.insert(l[i]), v.insert(r[i]);
	assert(v.size() == n*2);
	assert(tak() - aok() == m);
}
signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0);
	cin >> n >> m;
	if (n == 1 && m == 0) {
		cout << 1 << ' ' << 2 << '\n';
		return 0;
	}
	if (m < 0 || m > n-2)
		return puts("-1"), 0;
	construct(n, m);
}
