#include <bits/stdc++.h>
const long double r = 1e7;
const long double r2 = 0.9 * r;
const long double pi = 3.14159265359l;
const long double tau = 2 * pi;
const long double alpha = 0.01 * pi;
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  if (m == 3 && n > 4) {
    printf("-1\n");
    return 0;
  }
  for (int i = 0; i < m; i++)
    printf("%d %d\n", (int)(cos(i * tau / m) * r), (int)(sin(i * tau / m) * r));
  for (int i = 0; i < n - m; i++)
    printf("%d %d\n", (int)(cos(i * tau / m + alpha) * r2),
           (int)(sin(i * tau / m + alpha) * r2));
  return 0;
}
