#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline T int_ceil(T a, T b) { T res = a / b; if(a % b != 0) res++; return res; }
#include <bits/stdc++.h>
using namespace std;
template<typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
// sort(ALL(v), [](auto const& lhs, auto const& rhs) { return lhs > rhs; /* 左の方が大きい...というイメージ。*/ });
// --------------------------------------------------------------------------------------------- //

static const int MAX = 100001;
static const ll MOD = 1000000007;


int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	int N, M; cin >> N >> M;
	if(N == 1){
		if(M == 0){
			cout << 1 << " " << 2 << endl;
		}
		return 0;
	}
	if(M < 0 ||  M == N || M == N -1){
		cout << -1 << endl;
		return 0;
	}


	vector<pair<int, int> > ans;
	ll base = 1000001;
	ans.push_back({1, base});
	int k = 1;
	rep(i,  N-1 - M-1){
		ans.push_back({base + k, base + k+ 1});
		k+= 2;
	}
	k = 1;
	rep(i, M + 1){
		ans.push_back({1 + k, 1 + k + 1});
		k += 2;
	}

	sort(ALL(ans));
	rep(i, ans.size()){
		cout << ans[i].first << " " << ans[i].second << endl;
	}





	return 0;
}

#include <bits/stdc++.h>
#define rep(begin, end) for (i=begin;i<end;i++)
#define repj(begin, end) for (j=begin;j<end;j++)
#define init(arr, end, val) for (i=0;i<end;i++) arr[i] = val;
#define printint(i0, i1) printf("%d %d\n", i0, i1)

using namespace std;
typedef long long int ll;
const int inf = 1000000000;
const int mod = 1000000007;
const int nil = -1;
int i, n, m, k, ans;
int a[1000];

int main() {
    scanf(" %d %d", &n, &m);
    if (m == 0) {
        rep(0,n) printf("%d %d\n", 2+4*i, 4+4*i);
        exit(0);
    }
    if (m < 0 || m >= n-1) {
        printf("-1\n"); exit(0);
    }
    rep(0,n-1) {
        printf("%d %d\n", 2+4*i, 4+4*i);
    }
    printf("%d %d\n", i*4-m*4-3, i*4-1);
}