#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;

int solve(vector<pair<int, int>> ans) 
{
    return 0;
}

void Main()
{
    int n, m;
    cin >> n >> m;
    int c = n-abs(m);
    if (m < 0 || m == n || (m >= n-1 && n >= 2)) { 
        cout << -1 << endl;
        return;
    }
    vector<pair<int, int>> ans;
    int num = (m==0 ? n : n-1);
    for (int i = 0; i < num; i++)
    {
        ans.push_back(make_pair(3*i+2, 3*i+4));
    }
    if (m > 0) {
        ans.push_back(make_pair(1, 3*m+3));
    }

    for (int i = 0; i < n; i++)
    {
        cout << ans[i].first << " " << ans[i].second << endl;
    }
    

//     -- -- -- --
//    -----
//            -----
}

int main(int argc, char **argv)
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    Main();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> ti;

//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//using Bint = mp::cpp_int;

#define REP(a,b,c) for(ll a=b;a<(c);a++)
#define PER(a,b,c) for(ll a=b;a>=(c);a--)
 
inline ll ii(){ ll x; cin >> x; return x; }
inline string is(){ string x; cin >> x; return x; }
inline ld id(){ ld x; cin >> x; return x; }
inline void oi(ll x){ cout << x; }
inline void od(ld x){ cout << fixed << setprecision(12) << x; }
inline void os(string x){ cout << x; }
inline void oe(){ cout << endl; }
inline void oie(ll x){ oi(x); oe(); }
inline void ode(ld x){ od(x); oe(); }
inline void ose(string x){ os(x); oe(); }
inline void maxin(ll &a, ll b){ a=max(a,b); }
inline void minin(ll &a, ll b){ a=min(a,b); }

int main(){
    ll ret=100000;
    minin(ret, ii());
    minin(ret, ii());
    minin(ret, ii());
    minin(ret, ii());
    oie(ret);
    return 0;
}
