#include <bits/stdc++.h>
using namespace std;
pair<int, int> rec[210];
int n, m;
int main() {
  cin >> n >> m;
  if (m == 3) {
    if (n == 3) {
      puts("0 0\n10 0\n0 10");
    } else if (n == 4) {
      puts("0 0\n10 0\n0 10\n1 1");
    } else
      puts("-1");
    return 0;
  }
  int x = 0, y = 0;
  for (int i = 0; i < m; i++)
    rec[i] = pair<int, int>(x, y), x += 100000, y += (i + 1) * 100;
  for (int i = m; i < n; i++) {
    rec[i] = pair<int, int>(rec[i - m].first + 1, rec[i - m].second);
    if (i == m) rec[i] = pair<int, int>(-100000, -101);
    if (i - m == m - 1)
      rec[i] = pair<int, int>(100000000, rec[i - m].second + 1);
  }
  for (int i = 0; i < n; i++) printf("%d %d\n", rec[i].first, rec[i].second);
  return 0;
}
