#include <bits/stdc++.h>
const int MAX = 1000000;
int N, M;
int main() {
  assert(scanf("%d%d", &N, &M));
  if (M == 3 && N > 4) {
    printf("-1\n");
    return 0;
  }
  N -= M;
  int dx = 1, dy = 2, y = 0;
  for (int i = 0; i < M; ++i) {
    printf("%d %d\n", dx * i, y);
    y += dy * (i + 1);
  }
  y = 0;
  for (int i = 0; i < N; ++i) {
    printf("%d %d\n", MAX - dx * i, y);
    y += dy * (i + 1);
  }
  return 0;
}
