/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
using namespace std;
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      Ceil(x,y)           ((x+y-1)/y)
#define      sz(s)               (int)s.size()
#define      angle(x)            double(x * acos(-1) / 180.0)
#define      max_3(a,b,c)        max(a, max(b,c))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      all(v)              v.begin(),v.end()
#define      SORT(v)             sort(v.begin(),v.end())
#define      SRV(v)              sort(v.rbegin(),v.rend())
#define      REV(v)              reverse(v.begin(),v.end())
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      MP                  make_pair
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
constexpr ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=3e5+5;
vector<ll> adj[N];
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(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;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------------------START---------------------*/


/*-----*/
void solve(){
   ll n,m;
   string s;
   cin>>n>>m;
   if(m==0){
    ll bal=1;
    for(ll i=0;i<n;i++){
        cout<<bal<<' '<<bal+1<<endl;
        bal+=2;
    }
    return;
   }
   ll bal=abs(m);
   if((abs(n-m)<=1) || m<0){
    cout<<"-1";
    return;
   }
   ll k=2;
   if(m>0){
      cout<<"1"<<' '<<1000000000<<endl;
      for(ll i=0;i<m;i++){
        cout<<k<<' '<<k+1<<endl;
        k+=2;
      }
      n-=m+1;
      ll l=1000000,r=100000000;
      //cout<<k<<' '<<1000000<<endl;
     // k=1000000;
      //n--;
      for(ll i=0;i<n;i++){
        cout<<l<<' '<<r<<endl;
        r++; l++;
      }

   }



}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////   C O D I N G  I S  L I F E   ///////

#include <bits/stdc++.h>
using namespace std;
int main(){
	int N, M; cin >> N >> M; 
	if(abs(M) == N){
		cout << -1 << endl; return 0; 
	}
	if(M == 0){
		for(int i = 1; i <= N; i++){
			cout << i * 2 << " " << i * 2 + 1 << "\n"; 
		}
		return 0; 
	}
	if(abs(M) == N-1 || M < 0){
		cout << -1 << endl; return 0; 
	}
	else{
		for(int i = 0; i < N-1; i++){
			cout << i * 4 + 2 << " " << i * 4 + 4 << "\n";
		}
		if(M > 0){
			cout << 1 << " " << 3 + 4 * M << "\n"; 
		}
	}
}