#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    if (m == 3 && n > 4) {
      printf("-1\n");
      continue;
    }
    for (int i = 1; i <= m; i++) {
      printf("%d %d\n", i, 100000 + (i) * (i));
    }
    for (int i = 1; i <= n - m; i++) {
      printf("%d %d\n", i, -100000 - (i) * (i));
    }
  }
  return 0;
}
