#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (m == 3) {
    if (n == 4) {
      cout << 0 << ' ' << 0 << endl;
      cout << 3 << ' ' << 0 << endl;
      cout << 0 << ' ' << 3 << endl;
      cout << 1 << ' ' << 1 << endl;
      return 0;
    }
    if (n == 5 || n == 6) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 0; i < m; ++i) {
    cout << i << ' ' << int(1e6 + i * i) << endl;
  }
  int r = n - m;
  for (int i = 0; i < r; ++i) {
    cout << i << ' ' << int(-1e6 - i * i) << endl;
  }
  return 0;
}
