#include <bits/stdc++.h>
using namespace std;
int mm = 100000000;
int solx[405], soly[405];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (m == 3 && n >= 5) {
    printf("-1\n");
    return 0;
  }
  int x = -mm, y = -mm;
  int add = 110;
  for (int i = 1; i <= m; i++) {
    solx[i] = x;
    soly[i] = y;
    solx[m + i] = -x;
    soly[m + i] = y;
    x += add;
    y++;
    add--;
  }
  for (int i = 1; i <= n; i++) printf("%d %d\n", solx[i], soly[i]);
  return 0;
}
