#include <bits/stdc++.h>
using namespace std;
void solve(istream &in, ostream &out) {
  int n, m;
  in >> n >> m;
  if (n >= 5 && m == 3) {
    out << -1 << endl;
    return;
  }
  for (int x = 0; x < m; ++x) {
    int y = x * x + 10e6;
    out << x << ' ' << y << endl;
  }
  for (int x = 0; x < n - m; ++x) {
    int y = -x * x - 10e6;
    out << x << ' ' << y << endl;
  }
}
int main() {
  solve(cin, cout);
  return 0;
}
