#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (n >= 5 && m == 3) {
    return 0 * printf("-1\n");
  }
  vector<pair<int, int>> v;
  int pre = 0;
  int cur = 1000000;
  int MX = 500;
  for (int i = 1; i <= m; i++) {
    v.push_back({pre + MX - i, cur++});
    pre = pre + MX - i;
  }
  cur = -1000000;
  pre = 0;
  for (int i = 1; i <= n - m; i++) {
    v.push_back({pre + MX - i, cur--});
    pre = pre + MX - i;
  }
  for (auto t : v) {
    printf("%d %d\n", t.first, t.second);
  }
}
