#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
  point(int x = 0, int y = 0) : x(x), y(y) {}
};
int n, m;
vector<point> ans;
const int C = 30000000;
void Input() { cin >> n >> m; }
void Solve() {
  for (int i = 0; i < m; i++) ans.push_back(point(i, (i * (i + 1)) / 2));
  for (int i = 0; i < n - m; i++)
    ans.push_back(point(-i + C, (i * (i + 1)) / 2));
}
int main() {
  Input();
  if ((n == 6 && m == 3) || (n == 5 & m == 3)) {
    cout << -1 << endl;
    return 0;
  }
  Solve();
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].x << " " << ans[i].y << endl;
  return 0;
}
