#include <bits/stdc++.h>
using namespace std;
template <typename T>
T Abs(T first) {
  return (first < 0 ? -first : first);
}
template <typename T>
T Sqr(T first) {
  return (first * first);
}
const int INF = (int)1e9;
const long double EPS = 1e-9;
const long double PI = acos(-1.0);
void Read(int &first) {
  char c, r = 0, n = 0;
  first = 0;
  for (;;) {
    c = getchar();
    if (c == '-')
      n = 1;
    else if ((c >= '0') && (c <= '9'))
      first = first * 10 + c - '0', r = 1;
    else if (r)
      break;
  }
  if (n) first = -first;
}
int main() {
  if (0) freopen("in.txt", "r", stdin);
  int N, M;
  int i;
  long double r, a, second, first;
  Read(N), Read(M);
  if ((M == 3) && (N > 4)) {
    printf("-1\n");
    return (0);
  }
  if (M == 3) {
    printf("0 0\n");
    printf("10 0\n");
    printf("0 10\n");
    if (N == 4) printf("1 1\n");
    return (0);
  }
  r = 1e7;
  for (i = 0; i < M; i++) {
    a = (long double)i / M;
    a *= 2 * PI;
    first = r * cos(a);
    second = r * sin(a);
    printf("%d %d\n", int(first + 0.5), int(second + 0.5));
  }
  r = 1e6;
  for (i = 0; i < N - M; i++) {
    a = (long double)i / M;
    a *= 2 * PI;
    a += PI / 100;
    first = r * cos(a);
    second = r * sin(a);
    printf("%d %d\n", int(first + 0.5), int(second + 0.5));
  }
  return (0);
}
