#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
ll n,k;
cin>>n>>k;
if(k>n-1){
cout<<-1;
}
else if(k==1){
if(n==2)cout<<1<<' '<<2;
else cout<<-1;
}
else{
for(ll i=1;i<=k;i++){
cout<<i<<' '<<i+1<<'\n';
}
for(ll i=k+2;i<=n;i++){
cout<<2<<' '<<i<<'\n';
}
}
return 0;
}

京公网安备 11010502036488号