#include <bits/stdc++.h>
using namespace std;
void run();
int main() {
  ios::sync_with_stdio(0);
  run();
}
void run() {
  int n, m;
  cin >> n >> m;
  int z = n - m;
  if (m == 3 and n >= 5) {
    cout << "-1" << endl;
    return;
  }
  long long grad = m - 2;
  long long ay = 0, by = 10000007ll;
  for (long long x = 0; x < m; ++x, --grad) {
    if (true) {
      cout << x << " " << ay << endl;
      ay += grad;
    }
    if (x < z) {
      cout << x << " " << by << endl;
      by -= grad;
    }
  }
}
