#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  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;
    }
  }
  int first = 10000000;
  for (int i = (0); i <= (M - 1); i++)
    cout << i << ' ' << first + i * i << endl;
  for (int i = (0); i <= (N - M - 1); i++)
    cout << i << ' ' << -first - i * i << endl;
  return 0;
}
