#include "bits/stdc++.h"
using namespace std;
#include "string"
#define int long long
#define pi pair <int, int>
#define ff first
#define ss second
#define boost ios::sync_with_stdio(false);cin.tie(nullptr)
#define endl '\n'
#define vi vector<int> 

int32_t main() {
	boost;
	int n, m;
	cin >> n >> m;
	if(n == 1 && m == 0) {
		cout << 1 << ' ' << 2 << endl;
		return 0;
	}
	if(m < 0 or m >= n - 1) {
		cout << -1 << endl;
		return 0;
	}
	cout << 1 << ' ' << (int)1e7 << endl;
	int l = 2;
	for(int i = 0; i <= m; i++, l += 2)
		cout << l << ' ' << l + 1 << endl;
	l = 1e7 + 2;
	for(int i = 0; i < n - m - 2; i++, l += 2)
		cout << l <<' ' << l + 1<< endl;
}

#include<bits/stdc++.h>
using namespace std;
#define ll          long long
#define endl        "\n"
#define si(a)       scanf("%d",&a)
#define si2(a,b)    scanf("%d%d",&a,&b)
#define sl(a)       scanf("%lld",&a)
#define sl2(a,b)    scanf("%lld%lld",&a,&b)
#define pb          push_back
#define mk          make_pair
#define loop(n)     for(int i=0; i<n; i++)
#define FOR(a,b)    for(int i=a; i<=b; i++)
#define sz          size()
#define ff          first
#define ss          second
#define mem(a,val)  memset(a, val, sizeof(a))
#define md          1000000007
#define pi          acos(-1.0)

int main()
{
   ll n,m, l,r;
   cin>>n>>m;
   

   if(m==0)
   {
       l=2, r=3;
       for(int i=1; i<=n; i++)
       {
           printf("%lld %lld\n", l,r);
           //cout<<l<<" "<<r<<endl;
           l+=2, r+=2;
       }
       return 0;
   }
   if(m<0 || m>=n-1)
   {
       cout<<"-1"; return 0;
   }

   cout<<1<<" "<<(ll)1e7<<endl;
   l=2, r=3;
   for(int i=1; i<=m+1; i++)
       {
           printf("%lld %lld\n", l,r);
           l+=2, r+=2;
       }

    l=2e7, r=l+1;
   for(int i=m+3; i<=n; i++)
       {
          printf("%lld %lld\n", l,r);
           l+=2, r+=2;
       }
}
