#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(NULL);
  cout << (fixed) << setprecision(6);
  int n, m;
  while (cin >> n >> m) {
    if (m == 3) {
      if (n == 3)
        cout << "0 0\n0 1\n1 0\n";
      else if (n == 4)
        cout << "0 0\n10 0\n0 10\n1 1\n";
      else
        cout << -1 << endl;
    } else {
      for (int i = (1), _b = (m); i <= _b; i++)
        cout << i << ' ' << 1000111 + i * i << endl;
      for (int i = (1), _b = (n - m); i <= _b; i++)
        cout << i << ' ' << -(1000111 + i * i) << endl;
    }
  }
  return 0;
}
