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