#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int n, m;
double p[210][2];
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    if (m == 3) {
      if (n == 3) {
        printf("0 0\n0 1\n1 0\n");
        continue;
      }
      if (n == 4) {
        printf("0 0\n3 0\n0 3\n1 1\n");
        continue;
      }
      printf("-1\n");
      continue;
    }
    for (int i = 1; i <= m; i++) {
      printf("%d %d\n", i, -(n - i) * (n - i));
    }
    for (int i = 1; i <= n - m; i++) {
      printf("%d %d\n", -i, (n - i) * (n - i));
    }
  }
  return 0;
}
