#include <bits/stdc++.h>
#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma")
using namespace std;
using ll = long long int;
#define F first
#define S second
#define pb push_back
#define fast_io ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
const int N=2e5+10,LN=20,SQ=550,M=1e5+10;
const ll INF=1e18;
const int MOD=1000000007 /*998244353*/;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using pll=pair<ll,ll>;
using pii=pair<int,int>;
#define ordered_set tree<pair<pll,ll>, null_type,less<pair<pll,ll>>, rb_tree_tag,tree_order_statistics_node_update>
ll pow(ll x, ll y, ll mod){
    ll ans=1;
    while (y != 0) {
        if (y & 1) ans = ans * x % mod;
        y >>= 1;
        x = x * x % mod;
    }
    return ans;
}
ll n,m;
pll s[N];
int main(){
    fast_io;
    cin >> n >> m;
    if(n==1 && m==0) return cout << 1 << ' ' << 2 << '\n', 0;
    if(m>n-2 || m<0) return cout << -1 << '\n', 0;
    cout << 1 << ' ' << 2*m+4 << '\n';
    for(ll i=1; i<=m+1; i++){
        cout << i*2 << ' ' << i*2+1 << '\n';
    }
    for(ll i=m+2; i<n; i++) cout << 2*i+1 << ' ' << 2*i+2 << '\n';
    return 0;
}

//#include<cstdio>
//#include<cassert>
//#include<iostream>
//#include<cstring>
//#include<algorithm>
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define MAX ((int)1e8 + 5)
#define MAXP ((int)2e5)
#define MAXL ((ll)1e18 + 5)
#define MAX_X ((ll)1e5 + 2)
#define pi acos(-1)
#define M ((int)1e6 + 7)
#define MOD ((int)1e9 + 7)
#define MOD1 ((int)998244353 + 0)
#define BAS ((int)1e6 + 3)
#define BAS1 ((int)2e5 + 3)
#define NN ((int)1e5 + 5)
#define N ((int)2e5 + 5)
#define eps (1e-8)
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
#define logn 10
#define endl "\n"
#define mp make_pair
#define BUCK 105
#define LEF (idx<<1)
#define RIG ((idx<<1)|1)
//#define int ll


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;

/*fast io
ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/




typedef tree < int,  null_type,  less < int >,  rb_tree_tag,  tree_order_statistics_node_update > o_set;
typedef tree < pair < int, int >,  null_type,  less < pair < int, int > >,  rb_tree_tag,  tree_order_statistics_node_update > o_setp;
/// o_set s;
/// s.order_of_key(k) : Number of items strictly smaller than k .
/// *(s.find_by_order(k)) : K-th element in a set (counting from zero).

void ses()
{
    cout<<"-1\n";
    exit(0);
}

int main()
{
    fastio;
    int n , m;
    cin>>n>>m;
    if(m < 0 || m == n || (m == n-1 && n > 1) ) ses();
    else if(m == 0){
        for(int i = 1 ; i<=n ; i++) cout<<i+i-1<<" "<<i+i<<endl;
    }
    else{
        int rem = n - m-1 , from = 1 , too = MAX;
        while(rem--){
            cout<<from++<<" "<<too--<<endl;
        }
        rem = m+1;
        while(rem--){
            cout<<from<<" "<<1+from<<endl;
            from += 2;
        }
    }
    return 0;
}
