#include <bits/stdc++.h>
int n, m;
const int X = 1000000;
int f(int i) { return i * i + X; }
int main() {
  scanf("%d%d", &n, &m);
  if (m == 3) {
    if (n == 3) {
      printf("0 0\n1 0\n0 1\n");
      return 0;
    }
    if (n == 4) {
      printf("0 0\n10 0\n1 1\n0 10\n");
      return 0;
    }
    puts("-1");
    return 0;
  }
  for (int i = 0; i < m; ++i) printf("%d %d\n", i, f(i));
  for (int i = 0; i < n - m; ++i) printf("%d %d\n", i, -f(i));
  return 0;
}
