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