#include <bits/stdc++.h>
#define il inline
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define mid ((l+r)>>1)
#define MAXN 
#define MAXM 
#define mod 
#define inf (1ll << 30)
#define eps (1e-6)
#define alpha 0.75
#define rep(i, x, y) for(int i = x; i <= y; ++i)
#define repd(i, x, y) for(int i = x; i >= y; --i)
#define file(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, int> pli;
typedef pair <int, ll> pil;
typedef pair <ll, ll> pll;
template <typename T> il bool chkmin(T &x, T y) {return x > y ? x = y, 1 : 0;}
template <typename T> il bool chkmax(T &x, T y) {return x < y ? x = y, 1 : 0;}
template <typename T> il void read(T &x) {
	char ch = getchar(); int f = 1; x = 0;
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') x = x*10+ch-'0', ch = getchar();
	x *= f;
}
template <typename T, typename... Args> il void read(T &x, Args &...args) {
	read(x), read(args...);
}
int n, m;
int main() {
	read(n, m);
	if(n == 1 && m == 0) return cout << 1 << ' ' << 2 << endl, 0;
	if(m < 0 || m == n || m == n - 1) return cout << -1 << endl, 0;
	int p = n - m - 2;
	rep(i, 1, p) cout << i * 2 - 1 << ' ' << i * 2 << endl;
	cout << 2 * p + 1 << ' ' << 3 * n - 1 << endl;
	rep(i, p + 2, n) cout << i * 2 << ' ' << i * 2 + 1 << endl;
	return 0;
}
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#include <list>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template<typename T = int> using V = vector<T>;
template<typename T = int> using VV = vector<vector<T>>;
template <typename T, typename S>
ostream& operator<<(ostream& os, pair<T, S> a) {
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for (auto x : v) os << x << ' ';
    return os;
}
void debug() {
    cerr << '\n';
}
template <typename H, typename... T>
void debug(H a, T... b) {
    cerr << a;
    if (sizeof...(b)) cerr << ", ";
    debug(b...);
}

int solve(int n,vector<int>L, vector<int>R){
    vector<pii>a(n);
    rep(i,n){
        a[i] = pii(L[i], R[i]);
    }
    sort(a.begin(), a.end(), [](pii x, pii y){
        return x.second < y.second;
    });
    int pre = -1;
    int ans = 0;
    for(auto x: a){
        if(pre < x.first){
            ans++;
            pre = x.second;
        }
    }
    return ans;
}
int solve2(int n, vector<int>L, vector<int>R){
    vector<pii>a(n);
    rep(i,n){
        a[i] = pii(L[i], R[i]);
    }
    sort(a.begin(), a.end(), [](pii x, pii y){
        return x.first < y.first;
    });
    int pre = -1;
    int ans = 0;
    for(auto x: a){
        if(pre < x.first){
            ans++;
            pre = x.second;
        }
    }
    return ans;
}
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    if(m < 0){
        cout << -1 << endl;
        return 0;
    }
    vector<int>a(n), b(n);
    int t = 4;
    //[0,1], 2[3,4], 5[
    //[1,2] 3 [4,5]
    rep(i,n-1){
        a[i+1] = t++;
        b[i+1] = t++;
        t++;
    }
    a[0] = 1;
    b[0] = 3;
    rep(i,m+1)b[0] += 3;
    if(solve(n,a,b)-solve2(n,a,b)!=m){
        cout << -1 << endl;
        return 0;
    }
    rep(i,n){
        cout << a[i] << " " << b[i] << "\n";
    }
}


