#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define nl cout<<endl

#define pii pair<ll,ll>
#define vi  vector<ll>
#define vii vector<pii>
#define mi  map<ll,ll>
#define all(a)  (a).begin(),(a).end()

#define pb push_back
#define ff first
#define ss second
#define hell 1000000007

#define test4(x,y,z,a) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<"		a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"		y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;
#define N 300009

ll power(ll a,ll b,ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}
int main()
{	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
        
	ll n,m;cin>>n>>m;

	if(n==1 and m==0) {
		cout << "1 2"<<endl;
		return 0;
	}
	if(m >= (n-1) ) {
		cout<< -1<<endl; 
		return 0;
	}

	if(m == 0) {
		ll curr=1;
		rep(i,1,n+1) {
			cout<<curr<<" "<<curr+1<<endl;
			curr+=2;
		}
	}
	else if(m > 0 ) {
		cout << 1<< " "<< 1000000000<<endl;
		ll diff = m + 1;

		ll curr = 2;
		rep(i,0,diff-1) {
			cout<< curr <<" "<< curr+1<<endl;
			curr += 2;
		}
		ll curr2 = 1e8;

		ll more = 1 + diff - 1;
		more = n- more;
		rep(i,0,more) {
			cout<< curr <<" "<<curr2<<endl;
			curr++,curr2++;
		}
	}
	else
		cout<< -1 << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mk make_pair
int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    if(n==1&&m==0){
        printf("%d %d\n",1,2);
        return 0;
    }
    if(m<0||m==n||m==n-1){
        printf("-1\n");
    }
    else if(m==0){
         for (int i = 1; i <= n; ++i)
            printf("%d %d\n", i, i + n);
    }
    else{
        printf("%d %d\n",1,1000000);
        int idx=2;
        for(int i=1;i<=m+1;i++){
            printf("%d %d\n",idx,idx+1);
            idx+=2;
        }
        idx=1000010;
        for(int i=m+2;i<n;i++){
            printf("%d %d\n",idx,idx+1);
            idx+=2;
        }
    }
}