#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  if (M == 3) {
    if (N == 3) {
      cout << 0 << ' ' << 0 << endl;
      cout << 0 << ' ' << 1 << endl;
      cout << 1 << ' ' << 0 << endl;
      return 0;
    }
    if (N == 4) {
      cout << 0 << ' ' << 0 << endl;
      cout << 0 << ' ' << 10 << endl;
      cout << 10 << ' ' << 0 << endl;
      cout << 1 << ' ' << 1 << endl;
      return 0;
    }
    if (N >= 5) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0; i < M; i++) printf("%d %d\n", (i + 1) * i / 2 + 1, i);
  for (int i = 0; i < N - M; i++)
    printf("%d %d\n", -(i + 1) * i / 2 - 1543000, i);
  return 0;
}
