#include <bits/stdc++.h>

int n, m;

int main() {
  scanf("%d%d", &n, &m);
  if (m == 0) {
    for (int i = 1; i < 2 * n; i += 2) {
      printf("%d %d\n", i, i + 1);
    }
  } else if (m < 0 || m >= n - 1) {
    printf("-1\n");
  }  else {
    printf("1 1000000000\n");
    printf("2 1000000\n");
    int k1 = n - 2 - m;
    int k2 = m;
    for (int i = 1; i <= k1; ++i) {
      printf("%d %d\n", 1000000 - i, 1000000 + i);
    }
    int tmp = 1000000 + k1 + 1;
    for (int i = 1; i <= k2; ++i) {
      printf("%d %d\n", tmp, tmp + 1);
      tmp += 2;
    }
  }
  return 0;
}
#include <iostream>
#include <map>
#include <vector>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);
    int N,M,i,k=1;
    cin >> N >> M;
    if(N == 1 && M ==0){
        cout << 1 <<" "<< 2 <<"\n";
        return 0;
    }
    else if(M == 0 && N%2!=0){
        cout << -1;
        return 0;
    }
    else if(M<0){
        cout << -1;
        return 0;
    }
    else if(N-M<2){
        cout << -1;
        return 0;
    }
    cout << 1 << " " <<2*(M+2)<<"\n";
    for(i=2;i<2*(M+2);i+=2){
        k++;
        cout << i <<" "<<i+1<<"\n";
    }
    for(i=2*(M+2)+1;(k+1)<=N;i+=2){
        k++;
        cout << i <<" "<<i+1<<"\n";
    }
}
