#include <bits/stdc++.h>
using namespace std;
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int n, m, ans;
int i, j, k, l, t;
int main() {
  scanf("%d%d", &n, &m);
  if (m == 3 && n >= 5) {
    printf("-1\n");
    return 0;
  }
  for (i = 1; i <= m; i++) printf("%d %d\n", i, 88888888 + i * i);
  for (i = 1; i <= n - m; i++) printf("%d %d\n", i, -88888888 - i * i);
  return 0;
}
