#include <bits/stdc++.h>
using namespace std;
int x, y, n, m, p;
vector<pair<int, int> > ans;
int main() {
  cin >> n >> m;
  if (m == 3 && n >= 5) {
    cout << -1;
    return 0;
  }
  x = 1;
  y = 0;
  ans.push_back(make_pair(x, y));
  p = 0;
  while (ans.size() < m) {
    x += p;
    y++;
    ans.push_back(make_pair(x, y));
    p++;
  }
  for (int i = 0; i < m; i++)
    cout << ans[i].first << " " << ans[i].second << endl;
  for (int i = m; i < n; i++)
    cout << -99999 - ans[i - m].first << " " << ans[i - m].second << endl;
  return 0;
}
