#include <bits/stdc++.h>
using namespace std;
const int INF = 1e8;
int main() {
    int n, m;
    cin >> n >> m;
    if (m < 0) {
        cout << -1 << '\n';
        return 0;
    }
    if (m == 0) {
        for (int i = 1; i <= n; i++) {
            cout << 2 * i << ' ' << 2 * i + 1 << '\n';
        }
        return 0;
    }
    if (m > 0) {
        if (m >= n - 1) {
            cout << -1 << '\n';
            return 0;
        }
        for (int l = 1; l <= n - m - 1; l++) {
            cout << l << ' ' << l + INF << '\n';
        }
        for (int i = 1; i <= m + 1; i++) {
            int l = n - m - 1 + 2 * i;
            int r = l + 1;
            cout << l << ' ' << r << '\n';
        }
        return 0;
    }
}
#include <bits/stdc++.h>
//#define DEBUG
#define REP(i, nn ) for(int i = 0 ; i < (int) nn; i++)
#define deb(x) std::cout << #x << " " << x << endl;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
template<typename... T>
void read(T& ... a){
    ((cin >> a),...);
}
template<typename... T>
void write(T... a){
    ((cout << a << "\n"),...);
}

template<typename... T>
void write_space(T... a){
    ((cout << a << " "),...);
}

namespace atcoder {

// Implement (union by size) + (path compression)
// Reference:
// Zvi Galil and Giuseppe F. Italiano,
// Data structures and algorithms for disjoint set union problems
struct dsu {
  public:
    dsu() : _n(0) {}
    dsu(int n) : _n(n), parent_or_size(n, -1) {}

    int merge(int a, int b) {
        assert(0 <= a && a < _n);
        assert(0 <= b && b < _n);
        int x = leader(a), y = leader(b);
        if (x == y) return x;
        if (-parent_or_size[x] < -parent_or_size[y]) std::swap(x, y);
        parent_or_size[x] += parent_or_size[y];
        parent_or_size[y] = x;
        return x;
    }

    bool same(int a, int b) {
        assert(0 <= a && a < _n);
        assert(0 <= b && b < _n);
        return leader(a) == leader(b);
    }

    int leader(int a) {
        assert(0 <= a && a < _n);
        if (parent_or_size[a] < 0) return a;
        return parent_or_size[a] = leader(parent_or_size[a]);
    }

    int size(int a) {
        assert(0 <= a && a < _n);
        return -parent_or_size[leader(a)];
    }

    std::vector<std::vector<int>> groups() {
        std::vector<int> leader_buf(_n), group_size(_n);
        for (int i = 0; i < _n; i++) {
            leader_buf[i] = leader(i);
            group_size[leader_buf[i]]++;
        }
        std::vector<std::vector<int>> result(_n);
        for (int i = 0; i < _n; i++) {
            result[i].reserve(group_size[i]);
        }
        for (int i = 0; i < _n; i++) {
            result[leader_buf[i]].push_back(i);
        }
        result.erase(
            std::remove_if(result.begin(), result.end(),
                           [&](const std::vector<int>& v) { return v.empty(); }),
            result.end());
        return result;
    }

  private:
    int _n;
    // root node: -1 * component size
    // otherwise: parent
    std::vector<int> parent_or_size;
};

}  // namespace atcoder

using namespace atcoder;

void solve(){
    int n, m;
    cin >> n >> m;
    if(n == 1 && m == 0){
        cout << "1 2" << endl;
        return;
    }
    if(m < 0 || m >= n - 1){
        cout << - 1 << endl;
    }else{
        // it possible
        for(int i = 0 ; i < n - 1 ; i++){
            int l = 4 * i + 2;
            int r = l + 2;
            cout << l << " " << r << "\n";
        }
        // T has n - 1
        // A 
        int l = 1;
        int r = 4 * m + 3;
        cout << l << " " << r << endl;
    }
}

int main()
{
    //making data IO Fast
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    /****************************/
    solve();
    return 0;
}

