#include <bits/stdc++.h>

#define int long long
#define ll long long
#define ld long double

#define mod 1000000007
#define mod2 998244353
#define ff first
#define ss second
#define pb push_back
#define endl "\n"

#define vi vector<int>
#define si set<int>
#define pii pair<int,int>
#define mii map<int,int>
#define umii unordered_map<int,int>
#define vii vector<pii>
#define sii set<pii>
#define vvi vector<vi>
#define vvii vector<vii>
#define vsi vector<si>

#define in(arr,n) for(int i=0;i<n;i++)cin>>arr[i];
#define out(arr,n) for(int i=0;i<n;i++)cout<<arr[i]<<" ";cout<<endl;
#define inn(arr,m,n) for(int i=m;i<n;i++)cin>>arr[i];
#define outt(arr,m,n) for(int i=m;i<n;i++)cout<<arr[i]<<" ";cout<<endl;

#define narr int arr[n];in(arr,n)
#define nbrr int brr[n];in(brr,n)
#define intt(n,m) int n,m;cin>>n>>m;

using namespace std;
void solve1();

int power(int x, int y, int p){
    //if(x==0&&y==0)return 1;
    int res = 1;x = x % p;if (x == 0) return 0;
    while (y > 0){if (y & 1)res = (res*x) % p;y = y>>1;x = (x*x) % p;}
    return res;
}
int power(int x, int y){
    //if(x==0&&y==0)return 1;
    int res = 1;if (x == 0) return 0;
    while (y > 0){if (y & 1)res = (res*x);y = y>>1;x = (x*x);}
    return res;
}
int fib(int s1) {
    int s2, s4, s5, s3;
    s2 = s3 = 1;
    s4 = s5 = 0;
    while (s1 > 0) {
        if (s1 % 2 == 0) {
            int s6 = s3*s3;
            s3 = 2*s5*s3 + s6;
            s5 = s5*s5 + s6;
            s1 /= 2;
        } else {
            int s6 = s2*s3;
            s2 = s4*s3 + s6 + s2*s5;
            s4 = s4*s5 + s6;
            s1 -= 1;
        }
    }
    return s4;
}
int sum(int arr[],int a,int n)
{
    int zz=0;
    for(int i=a;i<n;i++)
    {
        zz+=arr[i];
    }
    return zz;
}
void solve(){
    int t;cin>>t;
    while(t--){solve1();}
}
signed main()
{
    //std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    solve1();
    return 0;
}

void solve1()
{
    int n,m,a,b;cin>>n>>m;
    if(n==1&&m==0)
    {
        cout<<1<< " "<<3<<endl;return;
    }
    if(((m<0)||(m>=n-1)))
    {
        cout<<-1<<endl;return;
    }
    int arr[n][2];
    arr[0][0]=2;arr[0][1]=4;
    for(int i=1;i<n;i++)
    {
        arr[i][0]=arr[i-1][0]+4;
        arr[i][1]=arr[i-1][1]+4;
    }
    if(m>0)
    {
        arr[0][1]+=(m)*4+3;
    }
    else if(m<0)
    {
        arr[n-1][0]-=3+(abs(m))*4;
    }
    for(int i=0;i<n;i++)
    {
        cout<<arr[i][0]<<" "<<arr[i][1]<<endl;
    }
}


#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
const ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
const int dx[4]={ 1,0,-1,0 };
const int dy[4]={ 0,1,0,-1 };

int N, M;

signed main(){
	cin >> N >> M;
	if(N == 1){
		if(M == 0) cout << 1 << " " << 2 << endl;
		else cout << -1 << endl;
		return 0;
	}
	if(N == 2){
		if(M == 0){
			cout << 1 << " " << 2 << endl;
			cout << 3 << " " << 4 << endl;
		}
		else{
			cout << -1 << endl;
		}
		return 0;
	}
	if(M < 0 || M > N-2){
		cout << -1 << endl;
		return 0;
	}

	if(M == 0){
		rep(i, N){
			cout << 2*i+1 << " " << 2*i+2 << endl;
		}
	}
	else{
		cout << 1 << " " << 100000000 << endl;
		rep(i, M+1){
			cout << 2*i+2 << " " << 2*i+3 << endl;
		}
		rep(i, N-1-(M+1)){
			cout << 100000000 + 2*i+1 << " " << 100000000 + 2*i+2 << endl;
		}
	}
}