#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef double dd;
#define tst int tttt;cin>>tttt;for(int TTTT=1;TTTT<=tttt;TTTT++)
#define nl cout<<"\n";
#define forn(a,b) for(int ii=a;ii<b;ii++)
const ll MOD1=1e9+7;
const ll MOD2=998244353;
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define vi vector<int>
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define hhh cout<<"here"<<endl;

ll mod=MOD1;
ll po(ll x,ll y) {y%=mod;ll res=1;while(y>0){if(y&1)res=(res*x);x=(x*x);y>>=1;}return res;}
ll gcd(int a, int b){if(a<b) swap(a,b);if(b==0) return a;return gcd(a%b,b);}

void solve(){
    int n,m;cin>>n>>m;
    if(n==1 && m==0){
        cout<<"1 2\n";return;
    }
    if(!(m>=0 && m<=n-2)){cout<<"-1\n";return;}
    int inf=1e8;
    forn(1,n-m){
        cout<<ii<<" "<<ii+inf;nl;
    }int i=0;
    forn(n-m,n+1){
        cout<<ii+i<<" "<<ii+1+i;nl;
        i++;
    }
}
int main(){

    // fastio
    // ++*(int*)0;// crash
    // freopen("out.txt","r",stdin);freopen("outt.txt","w",stdout);
    // tst
    {
        solve();
    }
}
/*


*/

#include<bits/stdc++.h>

using namespace std;

int main()
{
//	freopen("1.in","r",stdin);
	
	int n,m;
	scanf("%d %d",&n,&m);
	
	if(n==1)
	{
		if(m==0)printf("1 2\n");
		else puts("-1");
	}
	else
	{
		if(m<0 || m>n-2)puts("-1");
		else
		{
			int nn=n,r=0;
			if(m>=1)
			{
				printf("1 %d\n",n*2);
				--nn;r=1;
				
				for(int i=1;i<=m+1;++i)
				{
					printf("%d %d\n",r+1,r+2);
					--nn;r+=2;
				}
				
				r=n*2;
			}
			while(nn)
			{
				printf("%d %d\n",r+1,r+2);
				--nn;r+=2;
			}
			
			puts("");
		}
	}
	
	return 0;
}