#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10 + 1000;
const int INF = int(1e7);
int n, m;
int main() {
  ({
    int neg = 0;
    n = 0;
    char ch;
    for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
      if (ch == '-') neg = 1 - neg;
    n = ch - 48;
    for (ch = getchar(); ch >= '0' && ch <= '9'; ch = getchar())
      n = (n << 3) + (n << 1) + ch - 48;
    if (neg) n = -n;
  });
  ({
    int neg = 0;
    m = 0;
    char ch;
    for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
      if (ch == '-') neg = 1 - neg;
    m = ch - 48;
    for (ch = getchar(); ch >= '0' && ch <= '9'; ch = getchar())
      m = (m << 3) + (m << 1) + ch - 48;
    if (neg) m = -m;
  });
  if (m == 3 && (n == 5 || n == 6))
    printf("-1\n");
  else {
    for (int i = (0), _b = (m); i < _b; ++i) printf("%d %d\n", i, i * i + INF);
    for (int i = (0), _b = (n - m); i < _b; ++i)
      printf("%d %d\n", i, -i * i - INF);
  }
  return 0;
}
