#include <bits/stdc++.h>
using namespace std;
const double r1 = 1000000;
pair<int, int> mv(pair<int, int> x) { return x; }
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 3 && n > 4) {
    cout << -1 << endl;
    return 0;
  }
  vector<pair<int, int> > V;
  for (register int i = (0); i < (int)(m); ++i) {
    double deg = M_PI * i / (m - 1);
    V.push_back(mv(
        pair<int, int>(round(r1 * sin(deg)) - r1 * 3, round(r1 * cos(deg)))));
  }
  for (register int i = (0); i < (int)(n - m); ++i) {
    double deg = M_PI + M_PI * i / (m - 1);
    V.push_back(mv(
        pair<int, int>(round(r1 * sin(deg)) + r1 * 3, round(r1 * cos(deg)))));
  }
  for (register int i = (0); i < (int)(((int)(V).size())); ++i)
    cout << V[i].first << " " << V[i].second << endl;
  return 0;
}
