// {{{ by unolight
#include <bits/stdc++.h>
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-function"
#define SZ(x) ((int)(x).size())
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP1(i,a,b) for (int i = a; i <= (int)(b); i++)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

namespace { namespace unolight {
    
#ifdef UNOLIGHT
#include "dump.hpp"
#else
#define dump(...)
#endif

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template <class T, class F = less<T>>
void sort_uniq(vector<T> &v, F f = F()) {
    sort(begin(v), end(v), f);
    v.resize(unique(begin(v), end(v)) - begin(v));
}
// }}}

void main() {
    int n,m;
    cin >> n >> m;
    if ( m<0||(n==1 && m==1 )||(n>1 && m>n-2) ) {
        cout << -1 << '\n';
        return;
    }
    if ( n==1 ) {
        cout << 1 << ' ' << 2 << '\n';
        return;
    }
    int l=1, r=2*(m+1)+2;
    vector<PII> ans;
    ans.emplace_back(l,r);
    for ( int i=0; i<=m; i++ ) {
        int a=l+i*2+1;
        int b=a+1;
        ans.emplace_back(a,b);
    }
    int a=r+1;
    for ( int i=m+2; i<n; i++ ) {
        ans.emplace_back(a,a+1);
        a+=2;
    }
    for ( auto [i,j]:ans ) {
        cout << i << ' ' << j << '\n';
    }
}

// {{{ main
}}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    unolight::main();
    return 0;
}
// }}}
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp> // #include<ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp> //#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds; //using namespace __gnu_pbds;
#define pb push_back
#define ins insert
#define var auto
#define F first
#define S second
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
template <class T> using oset = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
const int Max = 4e5 + 10;
const int LOG = 30;
const int Mod = 1e9 + 7;
const int SQ = 3000;
const int INF = 1e9 + 10;
const int BMSK = 4e6;

ll pw(ll a , int b = Mod - 2)
{
	if(b == 0) return 1;
	ll half = pw(a , b / 2);
	if(b % 2) return half * half % Mod * a % Mod;
	return half * half % Mod;
}

void solve()
{
	int n , m;cin >> n >> m;
	if(n == 1 && m == 0)
	{
		cout << 1 << " " << 2 << '\n';
		return;
	}
	if(m < 0 || m >= n - 1)
	{
		cout << -1 << '\n';
		return;
	}

	for(int i = 0 ; i < n - 1 ; i++)
		cout << 3 * i + 2 << " " << 3 * i + 1 + 2 << '\n';
	cout << -1 + 2 << " " << 3 * m + 2 + 2 << '\n';

}

int32_t main()
{
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

//	int t;cin >> t;
//	while(t--)
	solve();
}
