/**
  *    █████╗  ██████╗       ██████╗ ██╗     ███████╗
  *   ██╔══██╗██╔════╝       ██╔══██╗██║     ╚══███╔╝
  *   ███████║██║            ██████╔╝██║       ███╔╝
  *   ██╔══██║██║            ██╔═══╝ ██║      ███╔╝
  *   ██║  ██║╚██████╗▄█╗    ██║     ███████╗███████╗
  *   ╚═╝  ╚═╝ ╚═════╝╚═╝    ╚═╝     ╚══════╝╚══════╝
  *
  *  @Author: TieWay59
  *  @Created: 2020/10/28 15:37
  *  @Link: https://atcoder.jp/contests/arc106/tasks/arc106_c
  *  @Tags:
  *
  *******************************************************/

#include <bits/stdc++.h>

#ifdef DEBUG

#   include "libs59/debugers.h"
//  #define debug(x)  cerr <<#x << " = "<<x<<endl;
#else
#   define endl '\n'
#   define debug(...)
#   define max(x,y) ((x)>(y)?(x):(y))
#   define min(x,y) ((x)>(y)?(y):(x))
#endif

#define STOPSYNC ios::sync_with_stdio(false);cin.tie(nullptr)
#define MULTIKASE int Kase=0;cin>>Kase;for(int kase=1;kase<=Kase;kase++)
typedef long long ll;
const int MAXN = 2e5 + 59;
const int MOD = 1e9 + 7;
const int INF = 0x3F3F3F3F;
const ll llINF = 0x3F3F3F3F3F3F3F3F;
using namespace std;
using pii = pair<int, int>;
using vint = vector<int>;

ll fpow(ll a, ll b, ll mod = MOD) {
    if (a % mod == 0) return 0;
    ll ret = 1;
    a %= mod;
    while (b) {
        if (b & 1)ret = ret * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ret;
}

int n, m;
const int shuff = 1e6;

void solve(int kaseId = -1) {
    cin >> n >> m;
    if (m < 0) {
        cout << -1 << endl;
    } else if (m == 0) {
        for (int i = 1; i <= n; ++i) {
            cout << i * 2 - 1 << " " << i * 2 << endl;
        }
    } else if (m < n - 1) {
        for (int i = 1; i <= m + 1; ++i) {
            cout << shuff + i * 2 - 1 << " " << shuff + i * 2 << endl;
        }
        int l = -1, r = (m + 1) * 2 + 1;
        for (int i = m + 2; i <= n; ++i) {
            cout << shuff + l << " " << shuff + r << endl;
            l--;
            r++;
        }
    } else {
        cout << -1 << endl;
    }
}

void solves() {
    MULTIKASE {
        solve(kase);
    }
}

int main() {
#ifdef DEBUG
    freopen("input.txt", "r+", stdin);
#endif
    STOPSYNC;
    solve();
    return 0;
}
/*

 */
/*  -*- coding: utf-8 -*-
 *
 * c.cc: C - Solutions
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 200000;

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int n, m;
  scanf("%d%d", &n, &m);

  if (m == 0) {
    for (int i = 1; i <= n; i++)
      printf("%d %d\n", 2 * i - 1, 2 * i);
    return 0;
  }

  if (m >= n - 1 || m < 0) {
    puts("-1");
    return 0;
  }

  printf("1 %d\n", 2 * (m + 2));
  for (int i = 1; i <= m + 1; i++)
    printf("%d %d\n", 2 * i, 2 * i + 1);
  for (int i = m + 3; i <= n; i++)
    printf("%d %d\n", 2 * i - 1, 2 * i);
  
  return 0;
}
