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