#include <bits/stdc++.h>
int main() {
  int x;
  int n, m;
  scanf("%d %d", &n, &m);
  if (m == 3 && n > 4) {
    printf("-1\n");
    return 0;
  }
  for (x = 0; x < m; ++x) printf("%d %d\n", x, x * x + 10001);
  for (x = 0; x < n - m; ++x) printf("%d %d\n", x, -x * x);
  return 0;
}
