#include <bits/stdc++.h>
using namespace std;
int N = 10000000;
vector<pair<int, int> > calc(int n, int m) {
  vector<pair<int, int> > res(n);
  for (int i = 0; i < m; i++) {
    res[i] = make_pair(i, i * i + N);
  }
  for (int i = 0; i < n - m; i++) {
    res[i + m] = make_pair(i, -i * i - N);
  }
  return res;
}
void solve(istream &in, ostream &out) {
  int n, m;
  in >> n >> m;
  if (n >= 5 && m == 3) {
    out << -1 << endl;
    return;
  }
  auto ans = calc(n, m);
  for (int i = 0; i < n; i++) {
    out << ans[i].first << ' ' << ans[i].second << endl;
  }
}
int main() {
  solve(cin, cout);
  return 0;
}
